ruff/crates/ruff_python_semantic/src/analyze
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
..
class.rs [`pylint`] Include name of base class in message for `redefined-slots-in-subclass` (`W0244`) (#15559) 2025-01-18 09:50:27 -06:00
function_type.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
imports.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
logging.rs Include inline instantiations when detecting loggers (#11154) 2024-04-25 21:00:12 -04:00
mod.rs Respect mixed `return` and `raise` cases in return-type analysis (#9310) 2023-12-29 16:46:37 +00:00
terminal.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
type_inference.rs Implement template strings (#17851) 2025-05-30 15:00:56 -05:00
typing.rs [`ruff`] Extend FA102 with listed PEP 585-compatible APIs (#20659) 2025-10-03 09:45:32 -04:00
visibility.rs [ty] Make `Module` a Salsa ingredient 2025-07-23 09:46:40 -04:00