tooling: pin the ruff rule selection and move CI to 0.16.1 - #40
Merged
Conversation
Ruff 0.16 widened its default lint selection (UP, LOG, BLE, I, RUF and more) and began formatting Python code blocks embedded in Markdown. The result was that an unchanged codebase reported 0 or 381 violations depending only on which ruff you ran, and four docs files showed phantom format diffs locally that CI never saw. Declare select = ["E4", "E7", "E9", "F"] explicitly so the project's rule set no longer depends on ruff's shifting defaults, exclude Markdown from check and format, and bump the CI pin. Verified clean on BOTH 0.16.1 and 0.15.21 with no source changes, so widening the rule set stays a deliberate act rather than an upgrade side-effect. Also adds .DS_Store to .gitignore; it was absent, which is why stray copies sat untracked in the working tree. Closes #39. Co-Authored-By: Claude Opus 5 (1M context) <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.
Closes #39. Also adds
.DS_Storeto.gitignore.What the investigation actually found
The issue as filed assumed the 0.15.21 -> 0.16.x delta was limited to Markdown formatting. It is not. Ruff 0.16 also widened its default lint selection, so on an unchanged codebase:
ruff check .ruff format --check .The 381 are real source, not Markdown: 194
UP045(Optional[X]->X | None), 44UP006(typing.List->list), 38LOG015, 17BLE001, and a long tail. The repo declared onlyignore, neverselect, so it silently inherited whatever the installed ruff considered default.The fix
Declare the selection explicitly so it stops depending on ruff's defaults:
That is exactly ruff's historical default set, so this preserves current behaviour rather than changing it. Verified clean on both versions with zero source changes:
548 passed.Deliberately not done
Adopting the 381 violations. That is a real codebase modernization touching type annotations throughout, with
requires-python >= 3.10implications, and it deserves its own reviewable diff rather than riding in on a pin bump. Wideningselectis now an explicit act.