Fix lint/format errors surfaced by ruff 0.16 default rules - #104
Merged
Conversation
ruff 0.16.0 expanded its default rule selection (adding I, UP, SIM and RUF categories) and now formats Python code blocks in Markdown. This broke CI on previously-clean code, since `ruff` is unpinned in requirements.txt. Adopt the new defaults instead of pinning: - apply auto-fixes for I001 (import sorting), UP032 (f-strings), SIM117 (combined with-statements), SIM118 (dict-keys) and RUF100 (unused `# noqa: E501` directives) - annotate setuptools Command attributes with typing.ClassVar (RUF012) - reformat the code samples in README.md via `ruff format`
josh-hadley
approved these changes
Aug 4, 2026
Member
Author
|
thank you @josh-hadley ! |
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.
Problem
CI has been failing on the Build & test (Linux) job across all open PRs (#101, #102, #103) and on
main. The failures are unrelated to those PRs' contents — they all fail on theruff check .lint step (Windows passes because linting only runs on Linux).Root cause:
ruffis unpinned inrequirements.txt. ruff 0.16.0 expanded its default rule selection (now includesI,UP,SIM,RUF) and started formatting Python code blocks in Markdown, which surfaced 19 lint errors + aREADME.mdformat diff on previously-clean code.Verified by bisection:
ruff0.15.0 → 0 errors;ruff0.16.0 → 19 errors.ruff 0.16.1 check . --select E4,E7,E9,F(the old defaults) passes, confirming the code itself is fine and the errors come purely from the expanded defaults.Fix
Adopt the new defaults rather than pinning ruff:
I001(import sorting),UP032(f-strings),SIM117(combinedwith),SIM118(dict.keys()),RUF100(unused# noqa: E501).RUF012: annotate setuptoolsCommandattributes (user_options,boolean_options) withtyping.ClassVar.ruff formatreformats the code samples inREADME.md.All changes are behavior-preserving.
ruff check .andruff format --check .both pass under ruff 0.16.1.