Skip to content

[ruff] Adopt the new default rule from 0.16 that are already green - #14895

Merged
Pierre-Sassoulas merged 2 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:ruff-enable-rules-that-already-pass
Aug 17, 2026
Merged

[ruff] Adopt the new default rule from 0.16 that are already green#14895
Pierre-Sassoulas merged 2 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:ruff-enable-rules-that-already-pass

Conversation

@Pierre-Sassoulas

Copy link
Copy Markdown
Member

lint.select was replacing the default values from ruff (maybe a good thing seeing the churn), but it means we missed the new default from ruff 0.16. I have a draft of everything that need fixing in my fork but let's go slow.

Pierre-Sassoulas and others added 2 commits August 17, 2026 12:03
``lint.select`` replaces ruff's default selection rather than adding to
it, so the 413 rules ruff 0.16 enables by default never applied here: 142
of them were outside our selection. Switching to ``lint.extend-select``
makes them apply again.

To keep this commit behaviour-neutral, every rule that was not already
running is added to ``lint.ignore``. The following commits remove those
entries one by one, fixing the code or documenting why the rule stays off.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Eighty-six of the rules ruff 0.16 enables by default are already satisfied by
the code base, so switching them on touches nothing but 'lint.ignore':
flake8-2020, flake8-async, flake8-comprehensions, flake8-datetimez,
flake8-executable, flake8-gettext, flake8-logging, flake8-logging-format,
flake8-pytest-style, flake8-simplify, flake8-type-checking, perflint, refurb
and tryceratops.

The rules from those same families that do need a code change get one commit
each, further along the branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Pierre-Sassoulas Pierre-Sassoulas added the skip news used on prs to opt out of the changelog requirement label Aug 17, 2026
@Pierre-Sassoulas
Pierre-Sassoulas merged commit 6c8ea15 into pytest-dev:main Aug 17, 2026
36 checks passed
@Pierre-Sassoulas
Pierre-Sassoulas deleted the ruff-enable-rules-that-already-pass branch August 17, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants