Last active
October 24, 2023 23:54
-
-
Save sequoiap/ae0ecc5d7f857c67fdb72be2ee725a47 to your computer and use it in GitHub Desktop.
Canonical pre-commit configuration for a Python project
This file contains 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
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v2.3.0 | |
hooks: | |
- id: check-yaml | |
- id: check-json | |
- id: check-merge-conflict | |
- id: mixed-line-ending | |
- id: end-of-file-fixer | |
types: [python] | |
- id: trailing-whitespace | |
types: [python] | |
- repo: https://github.com/PyCQA/autoflake | |
rev: v2.2.1 | |
hooks: | |
- id: autoflake | |
args: [--remove-all-unused-imports, --in-place] | |
- repo: https://github.com/psf/black | |
rev: 23.3.0 | |
hooks: | |
- id: black | |
- repo: https://github.com/pycqa/isort | |
rev: 5.12.0 | |
hooks: | |
- id: isort | |
name: isort (python) | |
files: src/.* | |
args: [--profile, black, --filter-files] | |
- repo: https://github.com/adamchainz/blacken-docs | |
rev: 1.13.0 | |
hooks: | |
- id: blacken-docs | |
additional_dependencies: | |
- black==23.3.0 | |
- repo: https://github.com/PyCQA/docformatter | |
rev: v1.6.5 | |
hooks: | |
- id: docformatter | |
args: [--in-place] | |
- repo: https://github.com/PyCQA/flake8 | |
rev: 6.0.0 | |
hooks: | |
- id: flake8 | |
- repo: https://github.com/pre-commit/mirrors-mypy | |
rev: v1.3.0 | |
hooks: | |
- id: mypy | |
exclude: ^(docs/) | |
# - repo: https://github.com/kynan/nbstripout | |
# rev: 0.6.1 | |
# hooks: | |
# - id: nbstripout | |
# files: ".ipynb" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment