Skip to content

chore(lint): pin ruff's rule selection explicitly - #34

Merged
fedorov merged 1 commit into
mainfrom
chore/pin-ruff-rule-selection
Jul 31, 2026
Merged

chore(lint): pin ruff's rule selection explicitly#34
fedorov merged 1 commit into
mainfrom
chore/pin-ruff-rule-selection

Conversation

@fedorov

@fedorov fedorov commented Jul 31, 2026

Copy link
Copy Markdown
Member

Why

CI on #33 fails at Lint (ruff) with 19 errors on code nobody touched.

The project has no [tool.ruff.lint] select, so it rides ruff's default rule selection. Ruff 0.16 expanded that default:

ruff default rules enabled ruff check src tests
0.15.21 (current lock) 59 All checks passed!
0.16.0 (#33) 413 Found 19 errors.

So a patch-range bump of the ruff pin silently became a lint policy change. The 19 findings are all newly-defaulted rules (S110, BLE001, I001, FURB192, RUF015, SIM102, UP033, UP037, FURB188, RUF100), not new code.

What

Select the previous default set explicitly.

Verified: 59 rules enabled and All checks passed! under both 0.15.21 and 0.16.0, ruff format --check clean on both.

Widening the set stays possible — it's now a deliberate edit to this list, landing with its fixes in the same PR, rather than arriving with whatever ruff release dependabot opens next.

Note

One of the 19 is worth knowing about if you ever do adopt the wider set: server.py:196's existing # noqa: BLE001 becomes unused under 0.16 (RUF100), because 0.16's BLE001 no longer fires when the handler calls logger.exception. So the other blind-except findings can't be silenced in the same style the file already uses.

Unblocks #33 (together with 35).

🤖 Generated with Claude Code

Ruff 0.16 expanded its *default* rule selection from 59 rules to 413. The project had no
`[tool.ruff.lint] select`, so it rode that default — which turned a patch-range bump of the
ruff pin into a lint policy change and failed CI with 19 errors on unmodified code.

Select the previous default set explicitly so `ruff check` is reproducible across upgrades.
Verified identical (59 rules, all checks passed) under both 0.15.21 and 0.16.0.

Widening the set is now a deliberate edit to this list, landing with its fixes in the same PR
rather than arriving with whatever ruff release dependabot happens to open next.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 31, 2026 18:46
@fedorov
fedorov merged commit f541552 into main Jul 31, 2026
4 checks passed
@fedorov
fedorov deleted the chore/pin-ruff-rule-selection branch July 31, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins Ruff’s lint rule selection explicitly in pyproject.toml so CI results don’t change when Ruff expands its default enabled rules. This keeps lint behavior reproducible across Ruff upgrades while still allowing the project to widen enforcement intentionally in a future PR.

Changes:

  • Add an explicit [tool.ruff.lint] section to avoid relying on Ruff’s evolving default rule set.
  • Set select = ["E4", "E7", "E9", "F"] to match the historical default checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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