Chore: Pin ruff rule selection - #336
Merged
tykeal merged 1 commit intoJul 30, 2026
Merged
Conversation
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
July 30, 2026 12:18
View session
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s Ruff configuration to explicitly pin which lint rules are selected, aiming to prevent CI/pre-commit behavior changes when Ruff’s default rule set shifts between releases.
Changes:
- Add
[tool.ruff.lint]with an explicitselectrule set and anignoreforE501. - Add
[tool.ruff.lint.per-file-ignores]fortests/**/*.pyto pre-emptively suppress rules that are expected to be relaxed in tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Without a select, ruff applies its default rule set, and that default is not stable across releases: 59 rules across 2 categories in 0.15.22, 413 across 38 in 0.16.0. A routine pre-commit autoupdate crossing that boundary changes which rules run, on code nobody has touched. That is what currently fails the open autoupdate pull request here. The selection is deliberately narrow. It is exactly the rule set this repository already satisfies, so pinning changes no behaviour today and both ruff 0.15.22 and 0.16.0 report all checks passing. Adopting the wider organisation superset is worthwhile but belongs in its own reviewed change. It currently reports 22 findings, 14 of them auto-fixable; the remainder are 6 B904 raise-without-from sites that need judgement about which exception context to preserve. Folding a refactor of error handling into a configuration chore would obscure both. The test per-file-ignores list rules that are not selected yet, so that widening the selection later does not immediately flag every test module. PLR0917 is there because tests stacking @patch decorators cannot satisfy it: unittest.mock injects each mock positionally, so a keyword-only signature is impossible rather than merely inconvenient. Co-authored-by: Claude <claude@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
ModeSevenIndustrialSolutions
force-pushed
the
chore/pin-ruff-rule-selection
branch
from
July 30, 2026 12:33
dce41f7 to
1300bea
Compare
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
July 30, 2026 12:34
View session
tykeal
approved these changes
Jul 30, 2026
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
Without a
select, ruff applies its default rule set, and that default is not stable across releases:A routine
pre-commitautoupdate crossing that boundary changes which rules run, on code nobody has touched. That is exactly what fails the open autoupdate PR #333 here.Deliberately narrow
The selection is precisely the rule set this repository already satisfies, so pinning changes no behaviour today: both ruff 0.15.22 and 0.16.0 report all checks passing.
Adopting the wider organisation superset (
E, W, F, I, B, C4, UP) is worthwhile but belongs in its own reviewed change — it currently reports 22 findings, 14 auto-fixable, with 6B904raise-without-from sites needing judgement about which exception context to preserve. Folding an error-handling refactor into a configuration chore would obscure both.