Skip to content

Instantly share code, notes, and snippets.

@julian-west
Last active November 30, 2023 04:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save julian-west/e50b25a9aa10551e3452f5a6cfaa6aa3 to your computer and use it in GitHub Desktop.
Save julian-west/e50b25a9aa10551e3452f5a6cfaa6aa3 to your computer and use it in GitHub Desktop.
Example .pre-commit-config.yaml file
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-added-large-files
args: ['--maxkb=1000']
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: check-yaml
- id: check-json
- id: pretty-format-json
args: ['--autofix']
- id: check-merge-conflict
- id: check-case-conflict
- id: check-docstring-first
- repo: local
hooks:
- id: isort
name: isort
stages: [commit]
language: system
entry: isort
types: [python]
- id: black
name: black
stages: [commit]
language: system
entry: black
types: [python]
- id: mypy
name: mypy
stages: [commit]
language: system
entry: mypy
types: [python]
- id: flake8
name: flake8
stages: [commit]
language: system
entry: flake8
types: [python]
exclude: setup.py
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.7.0
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
args: [--nbqa-mutate]
- id: nbqa-flake8
additional_dependencies: [flake8]
args: [--nbqa-mutate]
- id: nbqa-isort
additional_dependencies: [isort==5.7.0]
args: [--nbqa-mutate]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment