Skip to content

quoted-annotation

Pythonstyleno fixdefault: offpython/ruff

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).

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.

Reported
...
def f(x: "int"):
pass
from typing import TypeAlias
...
python:
lint:
rules:
quoted-annotation: warn # off (default), warn, error

Enabled by the presets: python/ruff.

Suppress one line with sudsy-disable-next-line quoted-annotation in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
ruff UP037 full