wemake-python-styleguide
wemake-python-styleguide copied to clipboard
False positive for WPS201 in __init__.py
WPS201 is reported in an __init__.py file that is used as a public module.
Such modules often re-export multiple objects to provide a convenient import surface.
Example:
from myapp.infra.dtos.example_parts.example_first import ExampleFirst as ExampleFirst
from myapp.infra.dtos.example_parts.example_second import ExampleSecond as ExampleSecond
Example usage:
from myapp.infra.dtos.example import example_parts
example_parts.ExampleFirst
example_parts.ExampleSecond
Expected behavior:
__init__.py acting as a public namespace module should not trigger WPS201.
Possible solutions:
Exclude __init__.py from WPS201.