Skip to content

build(lint): pin ruff's select explicitly, then unpin the version - #297

Merged
AVADSA25 merged 1 commit into
mainfrom
build/ruff-016-migration
Jul 24, 2026
Merged

build(lint): pin ruff's select explicitly, then unpin the version#297
AVADSA25 merged 1 commit into
mainfrom
build/ruff-016-migration

Conversation

@AVADSA25

Copy link
Copy Markdown
Owner

The real fix for the 0.16 breakage, replacing the <0.16 stopgap from #293.

Root cause

ruff.toml only ever set ignore, relying 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:

Rule Hits Ever chosen by this project?
BLE001 1029 no
I001 402 no
UP006 309 no
S110 193 no
DTZ005 139 no
ASYNC230 51 no

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:

select = ["E4", "E7", "E9", "F"]

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.16 is unnecessary — removed from both the workflow and requirements-dev.txt, so dependabot can keep upgrading freely.

Verified — same tree, both versions

ruff 0.15.22  -> All checks passed!
ruff 0.16.0   -> All checks passed!

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.

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>
@AVADSA25
AVADSA25 merged commit ef395db into main Jul 24, 2026
1 check passed
@AVADSA25
AVADSA25 deleted the build/ruff-016-migration branch July 24, 2026 16:40
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