quoted-annotation
What it does
Section titled “What it does”Reports a quoted name in a parameter, return or variable annotation when the target_version does not evaluate annotations at definition (3.14 and later).
Why it matters
Section titled “Why it matters”The quotes are there to delay evaluation of a name that is not defined yet. From Python 3.14 annotations are evaluated lazily by themselves, so the quotes only hide the name from tools and add noise.
To fix, remove the quotes.
Example
Section titled “Example”...
def f(x: "int"): pass
from typing import TypeAlias...Configuration
Section titled “Configuration”python: lint: rules: quoted-annotation: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line quoted-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 | UP037 |
full |