Skip to content

Instantly share code, notes, and snippets.

@ansara
Last active January 10, 2021 23:52
Show Gist options
  • Save ansara/1426309d9d94e9732e917b99089b534d to your computer and use it in GitHub Desktop.
Save ansara/1426309d9d94e9732e917b99089b534d to your computer and use it in GitHub Desktop.
Pre-commit config for Python. Standardizes formatting and enforces best practices across repo.
repos:
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.0.4
hooks:
- id: isort
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.1.3
hooks:
- id: python-safety-dependencies-check
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.10.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
language_version: python3.8
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
- repo: https://github.com/commitizen-tools/commitizen
rev: v1.23.0
hooks:
- id: commitizen
stages: [ commit-msg ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: detect-private-key
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment