-
Notifications
You must be signed in to change notification settings - Fork 28
/
.pre-commit-config.yaml
78 lines (64 loc) · 2.04 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# the default is to run these on commit + push
default_stages:
- pre-push
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
stages:
- pre-push
# Checks for a common error of placing code before the docstring.
- id: check-docstring-first
stages:
- pre-push
# Attempts to load all yaml files to verify syntax.
- id: check-yaml
stages:
- pre-push
# Attempts to load all json files to verify syntax.
- id: check-json
stages:
- pre-push
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
stages:
- pre-push
# Trims trailing whitespace.
- id: trailing-whitespace
stages:
- pre-push
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
stages:
- pre-push
# Simply check whether files parse as valid python.
- id: check-ast
stages:
- pre-push
# Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
stages:
- pre-push
# why use the local repo instead of hosted hooks? so that dependencies are centrally managed through poetry
- repo: local
hooks:
# note: this is used in lieu of autopep8 and yapf
- id: black
name: black
# note: why not use the official black pre-commit hook? so we can use poetry to control which version of black is used.
entry: make format
pass_filenames: false
language: system
# this is used in lieu of several flake8 plugins, isort, unimport, pulint, pyupgrade, pydocstyle, autoflake, mccabe
- id: ruff
name: ruff
entry: make lint-fix
pass_filenames: false
language: system
- id: mypy
name: mypy
entry: make check-types
pass_filenames: false
language: system