From 8cf62e9733517943a3a831f2a8d6c874e5920a8f Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Wed, 12 Aug 2026 11:28:23 -0700 Subject: [PATCH] lint lint lint --- openpilot/selfdrive/ui/sunnypilot/mici/layouts/onroad.py | 7 ++++--- .../ui/sunnypilot/mici/onroad/augmented_road_view.py | 5 ++--- .../selfdrive/ui/sunnypilot/mici/tests/test_scroller_sp.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openpilot/selfdrive/ui/sunnypilot/mici/layouts/onroad.py b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/onroad.py index 981d60f563..c50bab4f72 100644 --- a/openpilot/selfdrive/ui/sunnypilot/mici/layouts/onroad.py +++ b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/onroad.py @@ -4,6 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ +from collections.abc import Callable import pyray as rl from openpilot.system.ui.lib.application import gui_app from openpilot.selfdrive.ui.sunnypilot.mici.widgets.scroller_sp import ScrollerSP @@ -43,9 +44,9 @@ class OnroadViewContainerSP(ScrollerSP): def is_swiping_left(self) -> bool: return self.road_view.is_swiping_left() or self.onroad_info_panel.is_swiping_left() - def set_click_callback(self, callback) -> None: - self.road_view.set_click_callback(callback) - self.onroad_info_panel.set_click_callback(callback) + def set_click_callback(self, click_callback: Callable[[], None] | None) -> None: + self.road_view.set_click_callback(click_callback) + self.onroad_info_panel.set_click_callback(click_callback) def is_on_info_panel(self) -> bool: """True when scrolled past halfway toward onroad_info_panel (used by main layout diff --git a/openpilot/selfdrive/ui/sunnypilot/mici/onroad/augmented_road_view.py b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/augmented_road_view.py index acd4a162d0..70da900676 100644 --- a/openpilot/selfdrive/ui/sunnypilot/mici/onroad/augmented_road_view.py +++ b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/augmented_road_view.py @@ -5,7 +5,6 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -import pyray as rl from openpilot.selfdrive.ui.mici.onroad.augmented_road_view import AugmentedRoadView @@ -24,7 +23,7 @@ class AugmentedRoadViewSP(AugmentedRoadView): def set_show_confidence_ball(self, show: bool) -> None: self._show_confidence_ball = show - def _render(self, rect: rl.Rectangle) -> None: - super()._render(rect) + def _render(self, _) -> None: + super()._render(_) if self._show_confidence_ball: self._real_confidence_ball.render(self.rect) diff --git a/openpilot/selfdrive/ui/sunnypilot/mici/tests/test_scroller_sp.py b/openpilot/selfdrive/ui/sunnypilot/mici/tests/test_scroller_sp.py index 770d1a99d7..1e2746c563 100644 --- a/openpilot/selfdrive/ui/sunnypilot/mici/tests/test_scroller_sp.py +++ b/openpilot/selfdrive/ui/sunnypilot/mici/tests/test_scroller_sp.py @@ -45,7 +45,7 @@ def test_vertical_snap_items_are_supported(monkeypatch): monkeypatch.setattr(scroller.scroll_panel, "update", update) - visible_items = [ + visible_items: list[Widget] = [ DummyWidget(rl.Rectangle(0, -60, 100, 100)), DummyWidget(rl.Rectangle(0, 40, 100, 100)), ]