unused-annotation
What it does
Section titled “What it does”Reports a local variable that is annotated without a value and never read.
Why it matters
Section titled “Why it matters”x: int in a function declares a type and binds nothing. If the name is never used afterwards it is dead code left from a change.
To fix, remove it, or assign a value that is used.
Example
Section titled “Example”... pass _ = 5 annotated: int kept: int = 6 __tracebackhide__ = True return used, kept...Configuration
Section titled “Configuration”python: lint: rules: unused-annotation: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line unused-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 | F842 |
full |