ruff/crates/ruff_python_stdlib/src
liam ebfb33c30b
[ruff] Extend FA102 with listed PEP 585-compatible APIs (#20659)
Resolves https://github.com/astral-sh/ruff/issues/20512

This PR expands FA102’s preview coverage to flag every
PEP 585-compatible API that breaks without from `from __future__ import
annotations`, including `collections.abc`. The rule now treats asyncio
futures, pathlib-style queues, weakref containers, shelve proxies, and
the full `collections.abc` family 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.
2025-10-03 09:45:32 -04:00
..
sys python_stdlib: update for 3.14 (#18014) 2025-05-11 11:25:54 -05:00
builtins.rs [pyflakes] Fix false positives for __annotate__ (Py3.14+) and __warningregistry__ (F821) (#20154) 2025-09-23 08:16:00 -04:00
identifiers.rs Add an explicit fast path for whitespace to is_identifier_continuation (#9532) 2024-01-16 08:23:43 +00:00
keyword.rs [ruff] Implemented used-dummy-variable (RUF052) (#14611) 2024-12-03 08:36:16 +01:00
lib.rs [syntax-errors]: future-feature-not-defined (F407) (#20554) 2025-09-25 13:52:24 -04:00
logging.rs Fix logging rules with whitespace around dot (#6022) 2023-07-24 05:14:48 +00:00
open_mode.rs Use bitshift consistently for bitflag definitions (#14265) 2024-11-11 10:20:17 +00:00
path.rs Harmonise methods for distinguishing different Python source types (#13682) 2024-10-09 13:18:52 +00:00
str.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
typing.rs [ruff] Extend FA102 with listed PEP 585-compatible APIs (#20659) 2025-10-03 09:45:32 -04:00