Skip to content

fix(ci): preserve explicit Ruff lint baseline after upgrade - #224

Open
TimeToBuildBob wants to merge 3 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/restore-ruff-ci-baseline
Open

TimeToBuildBob wants to merge 3 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/restore-ruff-ci-baseline

Conversation

@TimeToBuildBob

@TimeToBuildBob TimeToBuildBob commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #225.

Problem

#218 upgraded the pinned Ruff action from 0.15.22 to 0.17.3. Ruff's default enabled rules changed: master now reports 150 violations across existing files, and unrelated PRs inherit the failure (including #223). [tool.ruff] also set no target-version, so pyupgrade-style fixes (e.g. UP017 → datetime.UTC, Python 3.11+) would ignore the declared python = "^3.8" support.

Master run: https://github.com/ActivityWatch/aw-server/actions/runs/42245017977

Fix

  • Set target-version = "py38" under [tool.ruff], matching tool.poetry.dependencies.python.
  • Pin the previous default selection explicitly (E4, E7, E9, F) and move the existing ignores into the supported [tool.ruff.lint] table, so future Ruff bumps can't silently widen it.

Keep the newer pinned action. Lint stays enabled, and there are no per-file exclusions or --fix --unsafe-fixes mass-applies. New rule families (FA100, UP, I001, …) can be adopted deliberately in separate PRs.

Verification

  • Reproduced on unmodified master: Ruff 0.17.3 reports 150 errors; 0.15.22 passes.
  • After the change, uvx ruff@0.15.22 check . and uvx ruff@0.17.3 check . both pass.
  • The effective enabled rule codes are identical under both versions (58 rules), and the resolved target is 3.8 for linter and formatter.
  • Negative control: an undefined-name stdin fixture still fails with F821.
  • Configuration only; no application code changes.

Git-Session-Id: ff1f7458-0544-5835-8d4c-86f6cfbc620d
@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This configuration-only change appears safe to merge.

Summary

The PR makes Ruff’s lint selection explicit without changing the pinned action.

  • The lint job keeps its rule set steady across Ruff upgrades.

Reviews (1) · Last reviewed commit: "fix(ci): preserve explicit Ruff lint bas..." · Reviewed by Greptile

@TimeToBuildBob

TimeToBuildBob commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 AI code review

The PR sets target-version = "py38" under [tool.ruff] in pyproject.toml. It adds [tool.ruff.lint] with an explicit selection of E4, E7, E9, and F, and moves the existing E402 and E501 ignores into that table.

Safe to merge — no P0/P1 findings

Confidence 5/5

✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads.

1 advisory finding (summary-only, not scored)

These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.

⚠️ P2 medium — pyproject.toml

This is a fix(...) PR but no test files are included in the diff. Erik's feedback: 'where is the repro & fixes they are supposed to catch' (gptme#3441), 'that measurement should come with a regression test' (gptme#3446). Add a test that would have caught this bug. (Advisory: Erik merged all such PRs but consistently requested tests.)

Add a test file that reproduces the bug before the fix and passes after it.

How this was verified: static preflight: fix-commit + touched-files scan (rule 7)

Files changed (1) — the diff as I read it
  • pyproject.toml — Sets Ruff's Python target to 3.8, explicitly selects four lint rule prefixes, and moves the existing ignores into [tool.ruff.lint].
Previous review passes
commit score findings engine when
7b0b5595a91e 5/5 0 subscription 2026-11-06 16:08 UTC
da5372d918bd 5/5 0 subscription 2026-11-09 09:03 UTC

Reviewed 9d7d078d8744 · panel: codex:gpt-6.1-sol · subscription engine · 14s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.

Outage coverage: 1-pass, not merge evidence. Subscription review supplied findings while full consensus capacity was unavailable. The consensus merge gate remains unsatisfied.

Git-Session-Id: f69034e5-7be4-4e81-a24b-e7b45ae284f2
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Pushed an empty commit to retrigger CI — the macOS job was CANCELLED on the previous run (not FAILED). All other checks (ubuntu, windows, typecheck, lint, format, CodeQL, Greptile) are ✅ on 7b0b5595. This PR is a dependency for #209, #223, and other PRs on old bases: master's lint is currently failing on the same pre-existing issues these PRs expose.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted.

Without target-version, Ruff infers no floor, so pyupgrade-style fixes
(e.g. UP017 -> datetime.UTC, 3.11+) could break the declared ^3.8 support
if those rule families are adopted later.

Refs ActivityWatch#225

Git-Session-Id: 9b655f9c-758f-5b15-b198-639d6fcfb45c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint red since ruff 0.17.3 (#218): pin target-version and rule selection

1 participant