unsorted-dunder-all
What it does
Section titled “What it does”Reports an __all__ list or tuple of strings that is out of order: constants (upper case) first, then classes (capitalized), then the rest, each group in natural order.
Why it matters
Section titled “Why it matters”A sorted list is easy to scan for a name, a merge does not put the same name in twice, and an added name has one obvious place.
To fix, sort the list.
Example
Section titled “Example”...
...
__all__ = ["b", "a"]
...Configuration
Section titled “Configuration”python: lint: rules: unsorted-dunder-all: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line unsorted-dunder-all 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 | RUF022 |
full |