[ruff] Extend FA102 with listed PEP 585-compatible APIs#20659
Merged
ntBre merged 8 commits intoastral-sh:mainfrom Oct 3, 2025
Merged
[ruff] Extend FA102 with listed PEP 585-compatible APIs#20659ntBre merged 8 commits intoastral-sh:mainfrom
ruff] Extend FA102 with listed PEP 585-compatible APIs#20659ntBre merged 8 commits intoastral-sh:mainfrom
Conversation
collections.abc typesruff] Extend FA102 with collections.abc types
amyreese
approved these changes
Oct 2, 2025
Contributor
|
ruff] Extend FA102 with collections.abc typesruff] Extend FA102 with rest of PEP 585 generics
ruff] Extend FA102 with rest of PEP 585 genericsruff] Extend FA102 with rest of PEP 585-compatible APIs
Contributor
Author
ruff] Extend FA102 with rest of PEP 585-compatible APIsruff] Extend FA102 with listed PEP 585-compatible APIs
amyreese
approved these changes
Oct 3, 2025
dcreager
added a commit
that referenced
this pull request
Oct 3, 2025
* origin/main: [`flake8-bugbear`] Include certain guaranteed-mutable expressions: tuples, generators, and assignment expressions (`B006`) (#20024) [`flake8-comprehensions`] Clarify fix safety documentation (`C413`) (#20640) [ty] improve base conda distinction from child conda (#20675) [`ruff`] Extend FA102 with listed PEP 585-compatible APIs (#20659) [`ruff`] Handle argfile expansion errors gracefully (#20691) [`flynt`] Fix f-string quoting for mixed quote joiners (`FLY002`) (#20662) [ty] Fix file root matching for `/` [ruff,ty] Enable tracing's `log` feature [`flake8-annotations`] Fix return type annotations to handle shadowed builtin symbols (`ANN201`, `ANN202`, `ANN204`, `ANN205`, `ANN206`) (#20612) Bump 0.13.3 (#20685) Update benchmarking CI for cargo-codspeed v4 (#20686) [ty] Support single-starred argument for overload call (#20223) [ty] `~T` should never be assignable to `T` (#20606) [`pylint`] Clarify fix safety to include left-hand hashability (`PLR6201`) (#20518) [ty] No union with `Unknown` for module-global symbols (#20664) [`ty`] Reject renaming files to start with slash in Playground (#20666) [ty] Enums: allow multiple aliases to point to the same member (#20669)
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.
Resolves #20512
This PR expands FA102’s preview coverage to flag every PEP 585-compatible API that breaks without from
from __future__ import annotations, includingcollections.abc. The rule now treats asyncio futures, pathlib-style queues, weakref containers, shelve proxies, and the fullcollections.abcfamily as generics once preview mode is enabled.Stable behavior is unchanged; the broader matching runs behind
is_future_required_preview_generics_enabled, letting us vet the new diagnostics before marking them as stable.I've also added a snapshot test that covers all of the newly supported types.
Check out https://docs.python.org/3/library/stdtypes.html#standard-generic-classes for a list of commonly used PEP 585-compatible APIs.