This is a script and pre-commit hook to check and update the __all__ variable in __init__.py files.
-
Install pre-commit:
pip install pre-commit
-
Install the pre-commit hooks:
pre-commit install
-
Add the hook to your
.pre-commit-config.yamlfile:repos: - repo: https://github.com/yourusername/your-repo rev: master hooks: - id: check-init-all
Now, on each commit, the hook will automatically check your __init__.py files.
- --line-length (default 120) set maximum line length
- --double-quotes use double quotes instead of single quotes