ruff: check newline (#30668)

* check newline

* nothing catches this
old-commit-hash: 97da129e11
chrysler-long2
Shane Smiskol 1 year ago committed by GitHub
parent 280bef4b0c
commit f5d1c4f371
  1. 2
      common/basedir.py
  2. 2
      common/kalman/simple_kalman.py
  3. 2
      common/time.py
  4. 8
      conftest.py
  5. 4
      pyproject.toml
  6. 2
      selfdrive/boardd/tests/test_pandad.py
  7. 2
      selfdrive/debug/auto_fingerprint.py
  8. 2
      selfdrive/test/cpp_harness.py
  9. 2
      selfdrive/test/helpers.py
  10. 2
      selfdrive/test/process_replay/conftest.py
  11. 2
      selfdrive/test/process_replay/helpers.py
  12. 2
      selfdrive/test/process_replay/test_processes.py
  13. 2
      selfdrive/ui/soundd.py
  14. 2
      system/hardware/hw.py
  15. 2
      tools/sim/bridge/carla/carla_bridge.py
  16. 2
      tools/sim/bridge/metadrive/metadrive_process.py
  17. 2
      tools/sim/lib/camerad.py
  18. 2
      tools/sim/lib/common.py
  19. 2
      tools/sim/lib/simulated_car.py
  20. 2
      tools/sim/lib/simulated_sensors.py

@ -1,4 +1,4 @@
import os 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 S = C.dot(P).dot(C.T) + R
K = P.dot(C.T).dot(np.linalg.inv(S)) K = P.dot(C.T).dot(np.linalg.inv(S))
P = (np.eye(len(P)) - K.dot(C)).dot(P) 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) MIN_DATE = datetime.datetime(year=2023, month=6, day=1)
def system_time_valid(): 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) @pytest.hookimpl(trylast=True)
def pytest_configure(config): def pytest_configure(config):
config_line = ( config_line = (
"xdist_group_class_property: group tests by a property of the class that contains them" "xdist_group_class_property: group tests by a property of the class that contains them"
) )
config.addinivalue_line("markers", config_line) config.addinivalue_line("markers", config_line)

@ -181,7 +181,7 @@ build-backend = "poetry.core.masonry.api"
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml # https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
[tool.ruff] [tool.ruff]
select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF008", "RUF100", "A", "B", "TID251"] 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 line-length = 160
target-version="py311" target-version="py311"
exclude = [ exclude = [
@ -202,4 +202,4 @@ flake8-implicit-str-concat.allow-multiline=false
"tools".msg = "Use openpilot.tools" "tools".msg = "Use openpilot.tools"
[tool.coverage.run] [tool.coverage.run]
concurrency = ["multiprocessing", "thread"] concurrency = ["multiprocessing", "thread"]

@ -116,4 +116,4 @@ class TestPandad(unittest.TestCase):
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()

@ -102,4 +102,4 @@ if __name__ == "__main__":
if not new_fw_versions: if not new_fw_versions:
print("No new fw versions found...") 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(): with OpenpilotPrefix():
ret = subprocess.call(sys.argv[1:]) 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): 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.ignore_msgs = request.config.getoption("--ignore-msgs")
request.cls.upload_only = request.config.getoption("--upload-only") request.cls.upload_only = request.config.getoption("--upload-only")
request.cls.update_refs = request.config.getoption("--update-refs") 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) 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__': if __name__ == '__main__':
pytest.main([*sys.argv[1:], __file__]) pytest.main([*sys.argv[1:], __file__])

@ -158,4 +158,4 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

@ -53,4 +53,4 @@ class Paths:
if PC: if PC:
return Paths.comma_home() return Paths.comma_home()
else: else:
return "/tmp/.comma" return "/tmp/.comma"

@ -19,4 +19,4 @@ class CarlaBridge(SimulatorBridge):
client.set_timeout(5) client.set_timeout(5)
return CarlaWorld(client, high_quality=self.high_quality, dual_camera=self.dual_camera, 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") # wide_road_image = get_cam_as_rgb("rgb_wide")
road_image[...] = get_cam_as_rgb("rgb_road") 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] 0.0, 0.0, 1.0]
} }
setattr(dat, pub_type, msg) 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 @abstractmethod
def reset(self): def reset(self):
pass pass

@ -116,4 +116,4 @@ class SimulatedCar:
if self.idx % 50 == 0: # only send panda states at 2hz if self.idx % 50 == 0: # only send panda states at 2hz
self.send_panda_state(simulator_state) 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: if (now - self.last_perp_update) > 0.25:
self.send_peripheral_state() self.send_peripheral_state()
self.last_perp_update = now self.last_perp_update = now

Loading…
Cancel
Save