pin ruff and state the lint rules explicitly - #10
Merged
Conversation
CI has been red on unchanged code. `ruff>=0.6` is unpinned, and ruff's *default* rule set widened in 0.16, so CI (which installed 0.16.4) reported 22 findings across 12 files while a local `.venv` on 0.15.12 reported none. Declare `[tool.ruff.lint] select` as ruff's pre-0.16 defaults -- the rules this project has actually been checked against -- so the selection is a project decision rather than whatever the installed ruff happens to default to, and pin ruff to `>=0.16,<0.17` so local and CI agree on the version. No source changes: main is clean under 0.16.4 once the selection is stated. Adopting the wider rule set is a separate question, left for its own change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI is red on
maintoday, on code nobody touched.ruff>=0.6is unpinned in the dev extra, and ruff's default rule set widened in 0.16.So CI, which installs the latest, now reports 22 findings across 12 files, while a local
.venvsitting on 0.15.12 reports none. That version skew is also whyscripts/check.shpasses locally and the same check fails in Actions.
Verified:
main+ ruff 0.15.12main+ ruff 0.16.4, inheriting default rulesmain+ ruff 0.16.4 + explicitselectWhat this does
[tool.ruff.lint] select = ["E4", "E7", "E9", "F"]— ruff'spre-0.16 defaults, i.e. exactly what this project has been checked against all along.
The selection becomes a project decision instead of tracking whatever ruff ships.
>=0.16,<0.17, so a contributor's local run and CI agree on theversion, not just the rule set.
No source changes —
mainis clean under 0.16.4 once the selection is declared.What this deliberately does not do
Adopt the wider 0.16 rule set. Those 22 findings are mostly legitimate (C408
dict()→literal ×7, SIM102 nested ifs ×4, UP035/UP037, PYI041, RUF022, PERF102, I001,BLE001), but acting on them is churn across 12 files and a separate decision. Worth its
own change if you want it.
black>=24is also unpinned and carries the same latent risk, though black's output hasbeen far more stable. Left alone here.
Note
This unblocks #9, which was reported red for these pre-existing findings and introduces
none of its own —
mainand that branch both report the identical 22 under 0.16.4.🤖 Generated with Claude Code