Created
December 4, 2024 13:24
-
-
Save mh0w/5a371c93c510a41dd69285bd2879c1a9 to your computer and use it in GitHub Desktop.
Python pre-commit hooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example pre commit hooks | |
repos: | |
- repo: local | |
hooks: | |
- id: flake8 | |
name: flake8 | |
entry: flake8 | |
stages: [commit] | |
language: system | |
types: [python] | |
exclude: 'cli/pipeline_template' | |
- repo: local | |
hooks: | |
- id: pydocstyle | |
name: pydocstyle | |
entry: pydocstyle | |
stages: [commit] | |
language: system | |
types: [python] | |
exclude: 'cli/pipeline_template' | |
- repo: local | |
hooks: | |
- id: black | |
name: black | |
entry: black | |
language: system | |
types: [python] | |
exclude: 'cli/pipeline_template' | |
- repo: local | |
hooks: | |
- id: isort | |
name: isort (python) | |
entry: black | |
language: system | |
types: [python] | |
exclude: 'cli/pipeline_template' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create .pre-commit-config.yaml, install pre-commit, pre-commit run | |
pip3 install pre-commit | |
pre-commit run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment