ruff/crates/ruff_linter/resources/test/fixtures/flake8_future_annotations
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
..
edge_case.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
from_typing_import.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
from_typing_import_many.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
import_typing.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
import_typing_as.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
no_future_import_uses_lowercase.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
no_future_import_uses_preview_generics.py [ruff] Extend FA102 with listed PEP 585-compatible APIs (#20659) 2025-10-03 09:45:32 -04:00
no_future_import_uses_union.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
no_future_import_uses_union_inner.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
ok_no_types.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
ok_non_simplifiable_types.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
ok_quoted_type.py Avoid flagging __future__ annotations as required for non-evaluated type annotations (#11414) 2024-05-21 18:57:13 +00:00
ok_uses_future.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
ok_variable_name.py Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00