close
Skip to content

[ruff] Enable a dozen rules from ruff 0.16 - #14915

Open
Pierre-Sassoulas wants to merge 3 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:ruff-enable-rules-needing-no-refactor
Open

[ruff] Enable a dozen rules from ruff 0.16#14915
Pierre-Sassoulas wants to merge 3 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:ruff-enable-rules-needing-no-refactor

Conversation

@Pierre-Sassoulas

Copy link
Copy Markdown
Member

Follow-up to #14913, manual this time, mostly disabling locally instead of globally.

Pierre-Sassoulas and others added 3 commits August 19, 2026 22:03
'logging.WARN' is another name for 'logging.WARNING', not a separate level, so
the dict literal listed the same integer key twice and only ever held one of
the two entries. LOG009 pointed this out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The argument is already a tuple, built by unpacking the previous scope, so
wrapping it in 'tuple()' copies it for nothing. C409 pointed this out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
FA102, N999, PGH005, PTH210, S112, LOG009 and the source half of C409 need no
change now that the two problems they found are fixed. The remaining four only
need a one-line exemption, because the violation is the thing under test:
SIM202 on the 'approx' operator overloading check, SIM222 and SIM223 in the
assertion rewriting tests, C409 where 'tuple([1, 2])' deliberately builds two
equal but distinct tuples ('assert v1 is not v2' on the next line).

Every exemption is a 'noqa' on the offending line rather than an entry in
'lint.ignore' or 'per-file-ignores', so the rules keep applying to the rest of
those files.

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 19, 2026

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@Pierre-Sassoulas

Copy link
Copy Markdown
Member Author

I can't merge this, probably because of the coverage. I'm going to look into it.

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.

2 participants