Skip to content

Use ruff select instead of extend-select to keep the rule set explicit - #6964

Merged
albertvillanova merged 1 commit into
mainfrom
ruff-select
Aug 31, 2026
Merged

Use ruff select instead of extend-select to keep the rule set explicit#6964
albertvillanova merged 1 commit into
mainfrom
ruff-select

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Aug 28, 2026

Copy link
Copy Markdown
Member

This PR makes TRL's ruff lint rule set explicit and independent of ruff's own default rule selection.

Motivation

Ruff 0.16 raised its default rule selection from 59 to 413 rules. extend-select adds onto those defaults, so TRL silently inherits every rule ruff enables by default, including whole families the project never opted into (BLE, SIM, S, TRY, LOG, DTZ, PL*, PIE, FURB, RUF, PYI, ...).

This has two consequences today:

Solution

Use select, which replaces the default selection instead of extending it. The listed rule families stay exactly as they are, so the set of rules TRL enforces becomes a project decision rather than a function of the installed ruff version. Adopting any of the newly defaulted rules remains a separate, deliberate change.

At the pinned ruff 0.13.3 this is a no-op: both configurations resolve to byte-identical sets of 170 enabled rules, and ruff check on all tracked Python files reports All checks passed! before and after. It also passes under ruff 0.16.4 with this change applied.

Changes

  • Replace extend-select with select in the ruff lint configuration
  • Add a comment recording why the rule set is pinned explicitly

Note

Low Risk
Config-only change to lint tooling; no runtime or application logic is affected.

Overview
Ruff linting is pinned to an explicit rule list so newer Ruff releases cannot silently turn on hundreds of extra default rules.

In pyproject.toml, [tool.ruff.lint] now uses select (replacing extend-select) with the same families (E, F, I, W, UP, B, T, C). A short comment documents that this avoids inheriting Ruff 0.16+’s expanded defaults. Behavior at the pinned Ruff version should be unchanged; local/editor runs on newer Ruff should align with CI instead of surfacing rules the project never opted into.

Reviewed by Cursor Bugbot for commit 1324eb0. Bugbot is set up for automated code reviews on this repo. Configure here.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova

Copy link
Copy Markdown
Member Author

Merging this PR as a fix of the CI to make it more solid.

@albertvillanova
albertvillanova merged commit 02dcb65 into main Aug 31, 2026
10 checks passed
@albertvillanova
albertvillanova deleted the ruff-select branch August 31, 2026 06:10
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.

1 participant