__all__ is used in runtime and for Sphinx API doc generation. It does not hold what can be referred to as “metadata”.
How it should be
If it's desired to disallow __all__ for some reason, that reason should be stated explicitly and be its own rule. If it's to be kept in the same rule, that rule's justification needs to be updated and the list of disallowed names made customizable through a flake8 setting.
It should be possible to use __all__ to declare what's “public API” of a module without having to stick noqa in every single place or disabling the rule entirely.
What's wrong
https://wemake-python-styleguide.rtfd.io/en/latest/pages/usage/violations/best_practices.html#wemake_python_styleguide.violations.best_practices.WrongModuleMetadataViolation says this rule is about packaging metadata, however
MODULE_METADATA_VARIABLES_BLACKLIST
includes__all__
which cannot be fixed by following the recommendation of sticking its value intopyproject.toml
since its function is fundamentally different.__all__
is used in runtime and for Sphinx API doc generation. It does not hold what can be referred to as “metadata”.How it should be
If it's desired to disallow
__all__
for some reason, that reason should be stated explicitly and be its own rule. If it's to be kept in the same rule, that rule's justification needs to be updated and the list of disallowed names made customizable through a flake8 setting.It should be possible to use
__all__
to declare what's “public API” of a module without having to sticknoqa
in every single place or disabling the rule entirely.Flake8 version and plugins
N/A
pip information
N/A
OS information
N/A