mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-20 13:32:04 +08:00
Ruff: disallow non-openpilot imports (#29841)
This commit is contained in:
+7
-1
@@ -167,7 +167,7 @@ build-backend = "poetry.core.masonry.api"
|
||||
|
||||
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
|
||||
[tool.ruff]
|
||||
select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF100", "A", "B"]
|
||||
select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF100", "A", "B", "TID251"]
|
||||
ignore = ["W292", "E741", "E402", "C408", "ISC003", "B027", "B024"]
|
||||
line-length = 160
|
||||
target-version="py311"
|
||||
@@ -180,3 +180,9 @@ exclude = [
|
||||
"third_party",
|
||||
]
|
||||
flake8-implicit-str-concat.allow-multiline=false
|
||||
[tool.ruff.flake8-tidy-imports.banned-api]
|
||||
"selfdrive".msg = "Use openpilot.selfdrive"
|
||||
"common".msg = "Use openpilot.common"
|
||||
"system".msg = "Use openpilot.system"
|
||||
"third_party".msg = "Use openpilot.third_party"
|
||||
"tools".msg = "Use openpilot.tools"
|
||||
@@ -40,7 +40,7 @@ from openpilot.system.loggerd.xattr_cache import getxattr, setxattr
|
||||
from openpilot.selfdrive.statsd import STATS_DIR
|
||||
from openpilot.system.swaglog import cloudlog
|
||||
from openpilot.system.version import get_commit, get_origin, get_short_branch, get_version
|
||||
from selfdrive.hardware.hw import Paths
|
||||
from openpilot.selfdrive.hardware.hw import Paths
|
||||
|
||||
|
||||
# TODO: use socket constant when mypy recognizes this as a valid attribute
|
||||
|
||||
@@ -21,7 +21,7 @@ from openpilot.selfdrive.athena import athenad
|
||||
from openpilot.selfdrive.athena.athenad import MAX_RETRY_COUNT, dispatcher
|
||||
from openpilot.selfdrive.athena.tests.helpers import MockWebsocket, MockParams, MockApi, EchoSocket, with_http_server
|
||||
from cereal import messaging
|
||||
from selfdrive.hardware.hw import Paths
|
||||
from openpilot.selfdrive.hardware.hw import Paths
|
||||
|
||||
|
||||
class TestAthenadMethods(unittest.TestCase):
|
||||
|
||||
@@ -3,8 +3,8 @@ import unittest
|
||||
|
||||
import cereal.messaging as messaging
|
||||
|
||||
from selfdrive.test.process_replay import replay_process_with_name
|
||||
from selfdrive.car.toyota.values import CAR as TOYOTA
|
||||
from openpilot.selfdrive.test.process_replay import replay_process_with_name
|
||||
from openpilot.selfdrive.car.toyota.values import CAR as TOYOTA
|
||||
|
||||
|
||||
class TestLeads(unittest.TestCase):
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ from logging.handlers import BaseRotatingHandler
|
||||
import zmq
|
||||
|
||||
from openpilot.common.logging_extra import SwagLogger, SwagFormatter, SwagLogFileFormatter
|
||||
from system.hardware.hw import Paths
|
||||
from openpilot.system.hardware.hw import Paths
|
||||
|
||||
|
||||
def get_file_handler():
|
||||
|
||||
Reference in New Issue
Block a user