Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallowing __all__ in WPS410 is not justified, nor is it customizable #3060

Closed
webknjaz opened this issue Oct 1, 2024 · 2 comments · Fixed by #3232
Closed

Disallowing __all__ in WPS410 is not justified, nor is it customizable #3060

webknjaz opened this issue Oct 1, 2024 · 2 comments · Fixed by #3232
Labels
bug Something isn't working

Comments

@webknjaz
Copy link
Contributor

webknjaz commented Oct 1, 2024

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 into pyproject.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 stick noqa in every single place or disabling the rule entirely.

Flake8 version and plugins

N/A

pip information

N/A

OS information

N/A

@webknjaz webknjaz added the bug Something isn't working label Oct 1, 2024
@sobolevn
Copy link
Member

sobolevn commented Oct 1, 2024

It should respect --i-control-code 👍

@webknjaz
Copy link
Contributor Author

webknjaz commented Oct 1, 2024

How?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants