Skip to content

Instantly share code, notes, and snippets.

@thinhha
Created April 21, 2022 10:02
Show Gist options
  • Save thinhha/d6afbd6d8511399ad74f7485094f2e86 to your computer and use it in GitHub Desktop.
Save thinhha/d6afbd6d8511399ad74f7485094f2e86 to your computer and use it in GitHub Desktop.
# See https://pre-commit.com/ for usage and config
files: '^(src|tests|scripts)\/\S*'
repos:
- repo: local
hooks:
- id: trailing-whitespace
name: trailing whitespace
stages: [commit]
language: system
entry: trailing-whitespace-fixer
types: [python]
- id: isort
name: import sort
stages: [commit]
language: system
entry: isort
types: [python]
args: ["--profile", "black"]
- id: black
name: format
stages: [commit]
language: system
entry: black
types: [python]
- id: flake8
name: lint
stages: [commit]
language: system
entry: flake8
types: [python]
- id: pydocstyle
name: docstring style
stages: [commit]
language: system
entry: pydocstyle
types: [python]
exclude: '^tests\/\S*'
# - id: mypy
# name: type check
# stages: [commit]
# language: system
# entry: mypy
# types: [python]
# exclude: setup.py
# - id: pytest
# name: pytest
# stages: [commit]
# language: system
# entry: python -m pytest
# types: [python]
# pass_filenames: false
# - id: pytest-cov
# name: pytest-cov
# stages: [push]
# language: system
# entry: python -m pytest --cov --cov-fail-under=40
# types: [python]
# pass_filenames: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment