ruff
ruff copied to clipboard
D101 does not consider __all__
A class without a _
preceeding its name is not public unless included in __all__
when __all__
is defined.
For example, the following file should not raise a D101.
__all__ = ()
class Hello:
...
Cool, this makes sense.
"Publicity" is the case for all in the D1xx group, not just D101. If there is an __all__
in the module, only the items listed as part of it should receive these checks. See here for details.
I'm working on this, but it requires some refactoring, since we can no longer track visibility as we iterate over the AST (since we might visit nodes before we see __all__
).
@charliermarsh BTW, I heard you on Talk Python. We need more people like you.