[pre-commit.ci] pre-commit autoupdate - #714
Merged
Merged
Conversation
pre-commit-ci
Bot
force-pushed
the
pre-commit-ci-update-config
branch
from
August 3, 2026 21:33
3ef64d8 to
fdef824
Compare
pre-commit-ci
Bot
force-pushed
the
pre-commit-ci-update-config
branch
from
August 10, 2026 21:33
0e34408 to
1690f86
Compare
Pierre-Sassoulas
approved these changes
Aug 11, 2026
Pierre-Sassoulas
force-pushed
the
pre-commit-ci-update-config
branch
2 times, most recently
from
August 12, 2026 05:42
9b13013 to
eb7ee84
Compare
updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.22 → v0.16.2](astral-sh/ruff-pre-commit@v0.15.22...v0.16.2)
for more information, see https://pre-commit.ci
Fixes the flake8-comprehensions C408 violations that ruff 0.16 reports now that it enables the rule by default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
``0 / 0`` as a statement is a deliberate "blow up here", and ``module.x.broken`` a deliberate attribute access, but both read as dead code, which is what flake8-bugbear B018 (enabled by default as of ruff 0.16) reports. Say what is meant instead: raise the error, and assign the attribute access that is only there for its side effect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ruff 0.16 enables flake8-simplify by default: * SIM102 in ``varnames()`` and in a test plugin manager: flatten a nested ``if`` into the branch condition. * SIM103 in the Sphinx warning filter: return the negated condition instead of branching to two literals. * SIM118 in ``HookCaller._verify_all_args_are_provided()``: membership on the mapping itself, no ``.keys()`` needed. Also parenthesizes the ``or``/``and`` condition ruff collapsed in the previous commit, which relied on operator precedence to be read right. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
``from collections.abc import Set`` shadows the reading of the ``set`` builtin at a glance, which is what flake8-pyi PYI025 (default as of ruff 0.16) points out. Alias it to ``AbstractSet``. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The hookimpl loop in ``PluginManager.register()`` reused ``name``, the method's own argument, for two different things: the attribute name being inspected on the plugin, and then the hook name it maps to. Give each its own name, as PLR1704 (default as of ruff 0.16) asks. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PERF402, enabled by default as of ruff 0.16. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
``varnames()`` and its benchmark counterpart fetch ``__call__`` to inspect the signature of a callable object. B004 (default as of ruff 0.16) reads that as an unreliable callable test and suggests ``callable()``, which returns a bool and would break both. Mark it, and say why in the code. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
``test_dist_facade_identity_equality_and_hash`` asserts that a facade equals itself, which is exactly the identity semantics under test. PLR0124 (default as of ruff 0.16) flags the self-comparison. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The multicall engine and ``Result.from_call()`` must capture whatever a hook implementation raised -- BaseException included -- and hand it to the hook wrappers; narrowing those handlers would change pluggy's contract. ``varnames()`` and ``parse_hookimpl_opts()`` likewise read attributes off arbitrary plugin objects, which may raise anything (see ``test_plugin_getattr_raises_errors``). flake8-blind-except is enabled by default as of ruff 0.16 and flags all thirteen sites. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
``test_wrapper_exception_chaining`` and ``test_plugin_getattr_raises_errors`` raise plain ``Exception`` deliberately: the point is that pluggy carries and chains exception types it knows nothing about. tryceratops is enabled by default as of ruff 0.16. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ruff already selects E, W and F, and ruff format owns line length, so flake8 only duplicated it -- and the two now disagree: ruff 0.16 enables RUF100, which removed the ``# noqa: E501`` on the documentation URL in ``_warn_teardown_exception()`` because ruff's own E501 does not flag a line that has nothing left to wrap, while flake8's E501 still does. The URL is 93 characters, so no indentation fits it under 99 either. The only hook-specific check lost is flake8-typing-imports, which warns about typing features newer than the minimum Python. pluggy requires 3.10, ruff infers the same target version from ``requires-python``, and mypy runs on every commit, so it had nothing left to catch. This also unpins pre-commit-hooks, which dropped its flake8 hook in v3.0.0 and could not be autoupdated past v2.1.0 while it was in use. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pierre-Sassoulas
force-pushed
the
pre-commit-ci-update-config
branch
from
August 12, 2026 05:45
eb7ee84 to
9564b0a
Compare
Member
|
@RonnyPfannschmidt I think the part that need review is this: 9564b0a (dropping flake8 for ruff) |
The previous commit claimed mypy already covered what flake8-typing-imports checked. That was only half true: ``[tool.mypy]`` set no ``python_version``, so mypy checked against whichever interpreter the hook happened to run on -- 3.14 in the pre-commit environment -- and a ``typing`` member added after 3.10 passed unnoticed. Pin it to 3.10, matching ``requires-python``. mypy then reads typeshed's ``sys.version_info`` guards and reports, for instance, ``Module "typing" has no attribute "Self"``, which is what TYP001 used to catch. It covers more than the plugin did, too: every guarded stdlib attribute rather than only ``typing`` imports, and uses as well as import lines. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
RonnyPfannschmidt
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updates: