chore(lint): pin ruff's rule selection explicitly - #34
Merged
Conversation
Ruff 0.16 expanded its *default* rule selection from 59 rules to 413. The project had no `[tool.ruff.lint] select`, so it rode that default — which turned a patch-range bump of the ruff pin into a lint policy change and failed CI with 19 errors on unmodified code. Select the previous default set explicitly so `ruff check` is reproducible across upgrades. Verified identical (59 rules, all checks passed) under both 0.15.21 and 0.16.0. Widening the set is now a deliberate edit to this list, landing with its fixes in the same PR rather than arriving with whatever ruff release dependabot happens to open next. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Pins Ruff’s lint rule selection explicitly in pyproject.toml so CI results don’t change when Ruff expands its default enabled rules. This keeps lint behavior reproducible across Ruff upgrades while still allowing the project to widen enforcement intentionally in a future PR.
Changes:
- Add an explicit
[tool.ruff.lint]section to avoid relying on Ruff’s evolving default rule set. - Set
select = ["E4", "E7", "E9", "F"]to match the historical default checks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 on #33 fails at Lint (ruff) with 19 errors on code nobody touched.
The project has no
[tool.ruff.lint] select, so it rides ruff's default rule selection. Ruff 0.16 expanded that default:ruff check src testsAll checks passed!Found 19 errors.So a patch-range bump of the
ruffpin silently became a lint policy change. The 19 findings are all newly-defaulted rules (S110,BLE001,I001,FURB192,RUF015,SIM102,UP033,UP037,FURB188,RUF100), not new code.What
Select the previous default set explicitly.
Verified: 59 rules enabled and
All checks passed!under both 0.15.21 and 0.16.0,ruff format --checkclean on both.Widening the set stays possible — it's now a deliberate edit to this list, landing with its fixes in the same PR, rather than arriving with whatever ruff release dependabot opens next.
Note
One of the 19 is worth knowing about if you ever do adopt the wider set:
server.py:196's existing# noqa: BLE001becomes unused under 0.16 (RUF100), because 0.16's BLE001 no longer fires when the handler callslogger.exception. So the other blind-except findings can't be silenced in the same style the file already uses.Unblocks #33 (together with 35).
🤖 Generated with Claude Code