mirror of https://github.com/commaai/openpilot.git
ruff: check newline (#30668)
* check newline
* nothing catches this
old-commit-hash: 97da129e11
This commit is contained in:
parent
280bef4b0c
commit
f5d1c4f371
|
@ -1,4 +1,4 @@
|
|||
import os
|
||||
|
||||
|
||||
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
|
||||
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
|
||||
|
|
|
@ -9,4 +9,4 @@ def get_kalman_gain(dt, A, C, Q, R, iterations=100):
|
|||
S = C.dot(P).dot(C.T) + R
|
||||
K = P.dot(C.T).dot(np.linalg.inv(S))
|
||||
P = (np.eye(len(P)) - K.dot(C)).dot(P)
|
||||
return K
|
||||
return K
|
||||
|
|
|
@ -3,4 +3,4 @@ import datetime
|
|||
MIN_DATE = datetime.datetime(year=2023, month=6, day=1)
|
||||
|
||||
def system_time_valid():
|
||||
return datetime.datetime.now() > MIN_DATE
|
||||
return datetime.datetime.now() > MIN_DATE
|
||||
|
|
|
@ -52,7 +52,7 @@ def pytest_collection_modifyitems(config, items):
|
|||
|
||||
@pytest.hookimpl(trylast=True)
|
||||
def pytest_configure(config):
|
||||
config_line = (
|
||||
"xdist_group_class_property: group tests by a property of the class that contains them"
|
||||
)
|
||||
config.addinivalue_line("markers", config_line)
|
||||
config_line = (
|
||||
"xdist_group_class_property: group tests by a property of the class that contains them"
|
||||
)
|
||||
config.addinivalue_line("markers", config_line)
|
||||
|
|
|
@ -181,7 +181,7 @@ build-backend = "poetry.core.masonry.api"
|
|||
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
|
||||
[tool.ruff]
|
||||
select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF008", "RUF100", "A", "B", "TID251"]
|
||||
ignore = ["W292", "E741", "E402", "C408", "ISC003", "B027", "B024"]
|
||||
ignore = ["E741", "E402", "C408", "ISC003", "B027", "B024"]
|
||||
line-length = 160
|
||||
target-version="py311"
|
||||
exclude = [
|
||||
|
@ -202,4 +202,4 @@ flake8-implicit-str-concat.allow-multiline=false
|
|||
"tools".msg = "Use openpilot.tools"
|
||||
|
||||
[tool.coverage.run]
|
||||
concurrency = ["multiprocessing", "thread"]
|
||||
concurrency = ["multiprocessing", "thread"]
|
||||
|
|
|
@ -116,4 +116,4 @@ class TestPandad(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
unittest.main()
|
||||
|
|
|
@ -102,4 +102,4 @@ if __name__ == "__main__":
|
|||
if not new_fw_versions:
|
||||
print("No new fw versions found...")
|
||||
|
||||
add_fw_versions(brand, platform, new_fw_versions)
|
||||
add_fw_versions(brand, platform, new_fw_versions)
|
||||
|
|
|
@ -8,4 +8,4 @@ from openpilot.common.prefix import OpenpilotPrefix
|
|||
with OpenpilotPrefix():
|
||||
ret = subprocess.call(sys.argv[1:])
|
||||
|
||||
exit(ret)
|
||||
exit(ret)
|
||||
|
|
|
@ -71,4 +71,4 @@ def with_processes(processes, init_time=0, ignore_stopped=None):
|
|||
|
||||
|
||||
def noop(*args, **kwargs):
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -34,4 +34,4 @@ def process_replay_test_arguments(request):
|
|||
request.cls.ignore_msgs = request.config.getoption("--ignore-msgs")
|
||||
request.cls.upload_only = request.config.getoption("--upload-only")
|
||||
request.cls.update_refs = request.config.getoption("--update-refs")
|
||||
request.cls.long_diff = request.config.getoption("--long-diff")
|
||||
request.cls.long_diff = request.config.getoption("--long-diff")
|
||||
|
|
|
@ -147,4 +147,4 @@ class TestProcessReplayDiffBase(TestProcessReplayBase):
|
|||
|
||||
diff_short, diff_long = format_process_diff(diff)
|
||||
|
||||
self.assertEqual(len(diff), 0, "\n" + diff_long if self.long_diff else diff_short)
|
||||
self.assertEqual(len(diff), 0, "\n" + diff_long if self.long_diff else diff_short)
|
||||
|
|
|
@ -96,4 +96,4 @@ class TestCarProcessReplay(TestProcessReplayDiffBase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pytest.main([*sys.argv[1:], __file__])
|
||||
pytest.main([*sys.argv[1:], __file__])
|
||||
|
|
|
@ -158,4 +158,4 @@ def main():
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
|
|
@ -53,4 +53,4 @@ class Paths:
|
|||
if PC:
|
||||
return Paths.comma_home()
|
||||
else:
|
||||
return "/tmp/.comma"
|
||||
return "/tmp/.comma"
|
||||
|
|
|
@ -19,4 +19,4 @@ class CarlaBridge(SimulatorBridge):
|
|||
client.set_timeout(5)
|
||||
|
||||
return CarlaWorld(client, high_quality=self.high_quality, dual_camera=self.dual_camera,
|
||||
num_selected_spawn_point=self.num_selected_spawn_point, town=self.town)
|
||||
num_selected_spawn_point=self.num_selected_spawn_point, town=self.town)
|
||||
|
|
|
@ -96,4 +96,4 @@ def metadrive_process(dual_camera: bool, config: dict, camera_array, controls_re
|
|||
# wide_road_image = get_cam_as_rgb("rgb_wide")
|
||||
road_image[...] = get_cam_as_rgb("rgb_road")
|
||||
|
||||
rk.keep_time()
|
||||
rk.keep_time()
|
||||
|
|
|
@ -67,4 +67,4 @@ class Camerad:
|
|||
0.0, 0.0, 1.0]
|
||||
}
|
||||
setattr(dat, pub_type, msg)
|
||||
self.pm.send(pub_type, dat)
|
||||
self.pm.send(pub_type, dat)
|
||||
|
|
|
@ -91,4 +91,4 @@ class World(ABC):
|
|||
|
||||
@abstractmethod
|
||||
def reset(self):
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -116,4 +116,4 @@ class SimulatedCar:
|
|||
if self.idx % 50 == 0: # only send panda states at 2hz
|
||||
self.send_panda_state(simulator_state)
|
||||
|
||||
self.idx += 1
|
||||
self.idx += 1
|
||||
|
|
|
@ -122,4 +122,4 @@ class SimulatedSensors:
|
|||
|
||||
if (now - self.last_perp_update) > 0.25:
|
||||
self.send_peripheral_state()
|
||||
self.last_perp_update = now
|
||||
self.last_perp_update = now
|
||||
|
|
Loading…
Reference in New Issue