Using Version Control Hooks¶
Usage with the pre-commit git hooks framework¶
Flake8 can be included as a hook for pre-commit. The easiest way to get
started is to add this configuration to your
- repo: https://github.com/pycqa/flake8 rev: '' # pick a git hash / tag to point to hooks: - id: flake8
See the pre-commit docs for how to customize this configuration.
Checked-in python files will be passed as positional arguments.
will always lint explicitly passed arguments (
flake8 --exclude has
no effect). Instead use
exclude: ... regex to exclude
pre-commit won’t ever pass untracked files to
.tox / etc. is unnecessary.
- id: flake8 exclude: ^testing/(data|examples)/
pre-commit creates an isolated environment for hooks. To use
plugins, use the
- id: flake8 additional_dependencies: [flake8-docstrings]