Skip to content

Repository files navigation

flake8-dunder-all

A Flake8 plugin and pre-commit hook which checks to ensure modules have defined '__all__'.

DocsDocumentation Build StatusDocs Check Status
TestsLinux Test StatusWindows Test StatusmacOS Test StatusCoverage
PyPIPyPI - Package VersionPyPI - Supported Python VersionsPyPI - Supported ImplementationsPyPI - Wheel
AnacondaConda - Package VersionConda - Platform
ActivityGitHub last commitGitHub commits since tagged versionMaintenancePyPI - Downloads
QACodeFactor GradeFlake8 Statusmypy status
OtherLicenseGitHub top languageRequirements Status

Installation

flake8-dunder-all can be installed from PyPI or Anaconda.

To install with pip:

$ python -m pip install flake8-dunder-all

To install with conda:

  • First add the required channels
$ conda config --add channels https://conda.anaconda.org/conda-forge
$ conda config --add channels https://conda.anaconda.org/domdfcoding
  • Then install
$ conda install flake8-dunder-all

flake8 codes

CodeDescription
DALL000Module lacks __all__.
DALL001__all__ not sorted alphabetically
DALL002__all__ not a list or tuple of strings.
DALL100Top-level __dir__ function definition is required.
DALL101Top-level __dir__ function definition is required in __init__.py.

Use as a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

- repo: https://gitlab.com/pycqa/flake8rev: 3.8.1hooks:
- id: flake8additional_dependencies: [flake8-dunder-all==0.6.0]

ensure-dunder-all script

There is also a script which will automatically add __all__ for files which don't have it.

See the documentation for details.

About

A Flake8 plugin and pre-commit hook which checks to ensure modules have defined '__all__'.

Topics

Resources

Contributing

Stars

8 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages