undefined-local-with-nested-import-star-usage
What it does
Section titled “What it does”Reports a star import in a function or class.
Why it matters
Section titled “Why it matters”Python rejects the file with SyntaxError: import * only allowed at module level since a function’s local names are fixed when it is compiled and cannot depend on what a module defines.
To fix, import the names you need, or move the import to module level.
Example
Section titled “Example”...
def nested(): from other import *
...Configuration
Section titled “Configuration”python: lint: rules: undefined-local-with-nested-import-star-usage: warn # off, warn (default), errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line undefined-local-with-nested-import-star-usage 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 | F406 |
full |