Skip to content

Fix lint/format errors surfaced by ruff 0.16 default rules - #104

Merged
miguelsousa merged 1 commit into
mainfrom
fix-ruff-0.16-defaults
Aug 4, 2026
Merged

Fix lint/format errors surfaced by ruff 0.16 default rules#104
miguelsousa merged 1 commit into
mainfrom
fix-ruff-0.16-defaults

Conversation

@miguelsousa

Copy link
Copy Markdown
Member

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 the ruff check . lint step (Windows passes because linting only runs on Linux).

Root cause: ruff is unpinned in requirements.txt. ruff 0.16.0 expanded its default rule selection (now includes I, UP, SIM, RUF) and started formatting Python code blocks in Markdown, which surfaced 19 lint errors + a README.md format diff on previously-clean code.

Verified by bisection: ruff 0.15.0 → 0 errors; ruff 0.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:

  • Auto-fixes: I001 (import sorting), UP032 (f-strings), SIM117 (combined with), SIM118 (dict.keys()), RUF100 (unused # noqa: E501).
  • RUF012: annotate setuptools Command attributes (user_options, boolean_options) with typing.ClassVar.
  • ruff format reformats the code samples in README.md.

All changes are behavior-preserving. ruff check . and ruff format --check . both pass under ruff 0.16.1.

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`
@miguelsousa

Copy link
Copy Markdown
Member Author

thank you @josh-hadley !

@miguelsousa
miguelsousa merged commit 39ec8d4 into main Aug 4, 2026
6 checks passed
@miguelsousa
miguelsousa deleted the fix-ruff-0.16-defaults branch August 4, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants