MichaelCurrin / py-project-template

Starter template for a Python app - including CI and docs 🐍 🌠
https://michaelcurrin.github.io/py-project-template/
MIT License
7 stars 3 forks source link

Add commit hooks #11

Open MichaelCurrin opened 4 years ago

MichaelCurrin commented 4 years ago

From Poetry

repos:
  - repo: https://github.com/psf/black
    rev: stable
    hooks:
      - id: black

  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.7.8
    hooks:
      - id: flake8

  - repo: https://github.com/timothycrosley/isort
    rev: 4.3.21-2
    hooks:
      - id: isort
        additional_dependencies: [toml]
        exclude: ^.*/?setup\.py$

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
      - id: trailing-whitespace
        exclude: ^tests/.*/fixtures/.*
      - id: end-of-file-fixer
        exclude: ^tests/.*/fixtures/.*
      - id: debug-statements
MichaelCurrin commented 4 years ago

See Cheatsheet around hooks