module-all-at-bottom

Require module __all__ declarations to appear after runtime definitions.

Message

Define module __all__ at the bottom of the file.

Valid examples

from package import value

def build() -> str:
    return value

__all__ = ["build"]
Show more
"""Module docstring."""

class Exported:
    pass

__all__: list[str] = ["Exported"]

Invalid examples

__all__ = ["build"]

def build():
    return "value"

Suggested fix

def build():
    return "value"

__all__ = ["build"]
Show more
__all__: list[str] = ["Exported"]

class Exported:
    pass
from package import value

__all__ = ["value"]
value = "updated"