undefined-local-with-import-star-usage
What it does
Section titled “What it does”Reports a name that no scope binds in a file that has a star import.
Why it matters
Section titled “Why it matters”With from m import * the names it brings in are not visible to a reader or a tool, so a name that is defined nowhere in the file may come from the import or may be a misspelling. The same file without the star import would be reported as undefined.
To fix, import the names that are used, or define them.
Example
Section titled “Example”...
__all__ = ["present", "from_star"]present = 1print(undefined, present, len)
def nested():...
def f(a: "Missing"): x: int...Configuration
Section titled “Configuration”python: lint: rules: undefined-local-with-import-star-usage: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line undefined-local-with-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 | F405 |
full |