Skip to content

Pin ruff and make the lint gate explicit - #74

Merged
psobot merged 1 commit into
masterfrom
psobot/pin-ruff
Aug 7, 2026
Merged

Pin ruff and make the lint gate explicit#74
psobot merged 1 commit into
masterfrom
psobot/pin-ruff

Conversation

@psobot

@psobot psobot commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Problem

Master's CI is red, and has been for a while — independently of any of the other open PRs.

CI runs pip install ruff (unpinned) and the repo declares no rule selection, so the lint gate has been "whatever this month's ruff considers default". Ruff's defaults have grown well past the original E4/E7/E9/F, and on unmodified master ruff check . now reports:

Found 125 errors.

spread across LOG015 (36), UP031 (29), BLE001 (10), UP004 (8), SIM115, C403, I001 and others. Every PR fails lint for reasons unrelated to its contents — #71, #72 and #73 all went red on this.

Fix

Select the rules explicitly, and pin ruff in CI.

The selection is exactly what master already passes (E4, E7, E9, F), so this restores the gate to what it was actually enforcing rather than silently adopting a much stricter one. Widening it is now a deliberate edit rather than a side effect of a ruff release — and widening it is worth doing, but as its own reviewable change, since ~76 of those errors are real modernization work (class Foo(object), %-formatting, IOError) rather than noise.

target-version is py310, not the py39 that would be inferred from requires-python: dumper/extract_mapping.py already uses a match statement, and the CI matrix starts at 3.10.

Verification

$ ruff check .          # ruff 0.16.2, with this config
All checks passed!

Note

This should land first#71, #72 and #73 are all red solely because of this, and will need a CI re-run once it's on master.

CI installs ruff unpinned and the repo declares no rule selection, so the lint
gate was whatever that month's ruff considered default. Ruff's defaults have
since grown well beyond the original E4/E7/E9/F, and `ruff check .` now reports
125 errors on unmodified master - across LOG015, UP031, BLE001, SIM115 and
others - so every pull request fails lint for reasons that have nothing to do
with its contents.

Select the rules explicitly and pin ruff in CI. The selection is exactly what
master already passes, so this restores the gate to what it was actually
enforcing rather than silently adopting a much stricter one; broadening it is
now a deliberate edit instead of a side effect of a ruff release.

target-version is py310 rather than the py39 inferred from requires-python,
because dumper/extract_mapping.py already uses a match statement and the CI
matrix starts at 3.10.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0179M4xvAKPGrgKpy4AeCsM7
@psobot psobot mentioned this pull request Aug 7, 2026
@psobot
psobot merged commit cd48e4c into master Aug 7, 2026
4 checks passed
@psobot
psobot deleted the psobot/pin-ruff branch August 7, 2026 15:26
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