Skip to content

ci: pin ruff select to the intended F + core-E policy (unblocks all PRs) - #55

Merged
adamjohnwright merged 1 commit into
mainfrom
fix/ruff-select-pin
Jul 30, 2026
Merged

ci: pin ruff select to the intended F + core-E policy (unblocks all PRs)#55
adamjohnwright merged 1 commit into
mainfrom
fix/ruff-select-pin

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Problem

The ruff Check workflow runs ruff check src/ bin/ on pull_request only — never on main. So main accumulated ~400 lint findings that were never gated, and now every PR fails ruff on that pre-existing backlog, regardless of what it changes.

Root cause

[tool.ruff.lint] sets ignore but never pins a select. Its own comment states the intent — "real issues (F, other E) stay enforced." Under exactly that policy the codebase is clean:

ruff check src/ bin/ --select E4,E7,E9,F --ignore E701,E702  →  All checks passed!

Without an explicit select, newer ruff enforces ~10 extra rule families that were never intended. ~310 of the ~400 findings are UP006 (Listlist PEP-585 modernization); the rest are import-sorting, blind-except, etc. Zero real F/E issues. The last config commit (04d68c9) clearly meant F+E and just forgot to pin select; it passed on that ruff version and drifted since.

Fix

Pin the select to the documented intent:

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F"]
ignore = ["E701", "E702"]
  • Greens CI for every open PR at once, zero code changes.
  • Stable against ruff default drift.
  • Opting into pyupgrade / import-sort / etc. later is a deliberate choice + its own cleanup PR (not silently-on via a default).

Verification

ruff check src/ bin/ (config-driven, no CLI flags) → All checks passed!

🤖 Generated with Claude Code

The ruff workflow runs `ruff check src/ bin/` on every PR but never on main, so
main accumulated ~400 lint findings that failed CI on every subsequent PR
regardless of the diff. The config set `ignore` but never pinned `select`, and
its own comment states the intent is "F + other E" — under exactly that policy
the codebase is clean (0 findings). Without an explicit select, newer ruff
enabled ~10 extra rule families (pyupgrade `List`->`list` alone is ~310 of the
findings), none of them real F/E issues.

Pin `select = ["E4","E7","E9","F"]` to match the documented intent and make it
stable across ruff default changes. Greens CI with zero code changes. Opting
into pyupgrade/import-sort/etc. later is a deliberate choice + its own cleanup.

Verified: `ruff check src/ bin/` → All checks passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 9742fe8 into main Jul 30, 2026
4 checks passed
@adamjohnwright
adamjohnwright deleted the fix/ruff-select-pin branch July 30, 2026 18:15
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.

1 participant