build(lint): pin ruff's select explicitly, then unpin the version - #297
Merged
Conversation
The real fix for the 0.16 breakage, replacing the <0.16 stopgap. ruff.toml only ever set `ignore` and relied on ruff's DEFAULT selection being "E4/E7/E9 + F". Ruff 0.16.0 widened those defaults, so `ruff check .` went from clean to 3117 errors with no code change — BLE001 x1029, I001 x402, UP006 x309, S110, DTZ005, ASYNC230, none of which this project ever chose. Inheriting a moving default meant CI's gate could change under us at any release. Naming the selection makes it version-proof: a future ruff can add whatever defaults it likes and this repo's gate stays exactly what it was. Widening is now a deliberate edit, not a surprise. Because the gate no longer depends on ruff's defaults, the <0.16 pin is unnecessary — removed from both the workflow and requirements-dev, so dependabot can keep upgrading. Verified "All checks passed" on 0.15.22 AND 0.16.0 with the same tree. Adopting 0.16's new rules (imports sorting, blind-except, datetime-tz) is now a separate, opt-in decision rather than something a release forces. Co-Authored-By: Claude Opus 4.8 <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.
The real fix for the 0.16 breakage, replacing the
<0.16stopgap from #293.Root cause
ruff.tomlonly ever setignore, relying on ruff's default selection being "E4/E7/E9 + F". Ruff 0.16.0 widened those defaults, soruff check .went from clean to 3117 errors with no code change:Inheriting a moving default means CI's gate can change under you at any release. That's the actual defect — 0.16 just exposed it.
Fix
Name the selection explicitly:
A future ruff can add whatever defaults it likes; this repo's gate stays what it was. Widening is now a deliberate edit, not a surprise.
And the pin comes back off
Since the gate no longer depends on ruff's defaults,
<0.16is unnecessary — removed from both the workflow andrequirements-dev.txt, so dependabot can keep upgrading freely.Verified — same tree, both versions
Adopting 0.16's new rules (import sorting, blind-except, datetime-tz) is now an opt-in decision rather than something a release forces on a Friday.