From 3a2ad0245c4928b0c837e2051bac6866e9eb417a Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Fri, 9 Oct 2026 22:05:02 +0200 Subject: [PATCH] deps: ruff 0.17.0 (CPY001 ignored: no copyright policy) Co-Authored-By: Claude Opus 5.5 (1M context) --- .pre-commit-config.yaml | 2 +- pyproject.toml | 3 +++ requirements.txt | 2 +- screen_locker/_phone_verification.py | 6 ++++-- screen_locker/_runnerup_db.py | 8 +++++--- screen_locker/_runnerup_verification.py | 6 ++++-- screen_locker/_status_view_verify.py | 6 ++++-- screen_locker/tests/_unlock_helpers.py | 1 + scripts/refresh_refactor_todo.py | 20 +++++++++++++------- 9 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e3a32d..163ff30 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,7 +62,7 @@ repos: files: ^(screen_locker/.*\.py|requirements\.txt)$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.2 + rev: v0.17.0 hooks: - id: ruff args: [--fix, --unsafe-fixes, --exit-non-zero-on-fix, --show-fixes] diff --git a/pyproject.toml b/pyproject.toml index db705f0..ec43d91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,9 @@ ignore = [ "D203", "D213", "COM812", + # Personal repo, no copyright policy (ruff 0.17 made CPY001 stable under + # select=ALL). + "CPY001", "ISC001", "S603", ] diff --git a/requirements.txt b/requirements.txt index 82d33fc..9cef12b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ pytest-xdist==3.8.0 # token over the REST endpoint; crdt-sync already pulls requests in, but this # module imports it itself, so it is declared rather than assumed. requests==2.34.2 -ruff==0.16.10 +ruff==0.17.0 types-requests==2.33.0.20261006 # Direct dependency since the Firebase session stream (_session_stream) catches # urllib3's own errors on the long-lived SSE read; requests pulls it in, but diff --git a/screen_locker/_phone_verification.py b/screen_locker/_phone_verification.py index 5679bbf..4d5e364 100644 --- a/screen_locker/_phone_verification.py +++ b/screen_locker/_phone_verification.py @@ -78,8 +78,10 @@ class PhoneVerificationMixin(AdbTransportMixin, HttpWorkoutFetchMixin): if duration_min < WORKOUT_DURATION_ACCEPT_MINUTES: return ( "too_short", - f"Workout too short! {duration_min:.0f} min logged, " - f"need at least {MIN_WORKOUT_DURATION_MINUTES} min.", + ( + f"Workout too short! {duration_min:.0f} min logged, " + f"need at least {MIN_WORKOUT_DURATION_MINUTES} min." + ), ) flag = "all succeeded" if data.get("succeeded") else "partial" return "verified", f"Workout verified! ({duration_min:.0f} min, {flag})" diff --git a/screen_locker/_runnerup_db.py b/screen_locker/_runnerup_db.py index cb016d8..0ed4283 100644 --- a/screen_locker/_runnerup_db.py +++ b/screen_locker/_runnerup_db.py @@ -151,9 +151,11 @@ class RunnerUpDbMixin: if db_path is None: return ( "not_verified", - "No TCX export found and root DB access is unavailable on this " - "device — enable RunnerUp's File Synchronizer auto-export so " - "runs land in /sdcard/Documents/RunnerUp/", + ( + "No TCX export found and root DB access is unavailable on " + "this device — enable RunnerUp's File Synchronizer " + "auto-export so runs land in /sdcard/Documents/RunnerUp/" + ), ) try: diff --git a/screen_locker/_runnerup_verification.py b/screen_locker/_runnerup_verification.py index b60d153..c7a40f2 100644 --- a/screen_locker/_runnerup_verification.py +++ b/screen_locker/_runnerup_verification.py @@ -224,7 +224,9 @@ class RunnerUpVerificationMixin( if not self._has_adb_device(): return ( "not_verified", - f"No RunnerUp export for today in {RUNNERUP_WEBDAV_DIRS} and the " - "phone is not adb-reachable", + ( + f"No RunnerUp export for today in {RUNNERUP_WEBDAV_DIRS} " + "and the phone is not adb-reachable" + ), ) return self._verify_runnerup_via_db() diff --git a/screen_locker/_status_view_verify.py b/screen_locker/_status_view_verify.py index 173c3af..287836e 100644 --- a/screen_locker/_status_view_verify.py +++ b/screen_locker/_status_view_verify.py @@ -205,8 +205,10 @@ class PhoneCheckMixin: else: self._phone_check_result = ( outcome.status, - f"StrongLifts: {outcome.phone_message} · " - f"RunnerUp: {outcome.runnerup_message}", + ( + f"StrongLifts: {outcome.phone_message} · " + f"RunnerUp: {outcome.runnerup_message}" + ), ) self.render(gather_status()) diff --git a/screen_locker/tests/_unlock_helpers.py b/screen_locker/tests/_unlock_helpers.py index ee2fde6..701374d 100644 --- a/screen_locker/tests/_unlock_helpers.py +++ b/screen_locker/tests/_unlock_helpers.py @@ -21,6 +21,7 @@ if TYPE_CHECKING: def setup_unlock( mock_tk: MagicMock, tmp_path: Path, + *, weekly_count: int = 5, streak: int = 0, adjust_ok: bool = True, diff --git a/scripts/refresh_refactor_todo.py b/scripts/refresh_refactor_todo.py index 0cb5919..3579eea 100755 --- a/scripts/refresh_refactor_todo.py +++ b/scripts/refresh_refactor_todo.py @@ -145,11 +145,15 @@ def render_table(rows: list[tuple[int, int, int, Path]]) -> str: out += [ f"- **{total_files} files** currently exceed 250 lines.", - f"- **{total_over:,} lines** over the cap in total (the work left to " - f"do); longest file is **{longest}** lines.", + ( + f"- **{total_over:,} lines** over the cap in total (the work left " + f"to do); longest file is **{longest}** lines." + ), "", - "ROI = lines x commits in the last year. Work top-down; a long file " - "nobody edits", + ( + "ROI = lines x commits in the last year. Work top-down; a long " + "file nobody edits" + ), "has near-zero payoff and should not be first.", "", "| lines | commits/yr | kind | file |", @@ -162,9 +166,11 @@ def render_table(rows: list[tuple[int, int, int, Path]]) -> str: if remaining > 0: out += [ "", - f"_({remaining} further files over 250 lines not listed — " - "re-run `python3 scripts/refresh_refactor_todo.py` for the " - "current set.)_", + ( + f"_({remaining} further files over 250 lines not listed — " + "re-run `python3 scripts/refresh_refactor_todo.py` for the " + "current set.)_" + ), ] out += ["", END_MARKER] return "\n".join(out)