useless-import-alias
What it does
Section titled “What it does”Reports import a as a and from m import a as a.
Why it matters
Section titled “Why it matters”The alias repeats the name, so it adds nothing in an ordinary import. Type checkers read the form as an explicit re-export, but the rule still reports it.
To fix, remove the alias.
Example
Section titled “Example”...class A:...
import os as os
...Configuration
Section titled “Configuration”python: lint: rules: useless-import-alias: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line useless-import-alias 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 | PLC0414 |
full |