type-alias-annotation
What it does
Section titled “What it does”Reports X: TypeAlias = ... when the target_version has the type statement (3.12 and later).
Why it matters
Section titled “Why it matters”type X = ... declares the alias as one, evaluates the right side lazily (so it can refer to later names) and needs no import of TypeAlias.
To fix, write type X = ....
Example
Section titled “Example”... pass
from typing import TypeAliasX: TypeAlias = int
from typing import Generic, TypeVarT = TypeVar("T")...Configuration
Section titled “Configuration”python: lint: rules: type-alias-annotation: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line type-alias-annotation in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| ruff | UP040 |
full |