-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
72 lines (62 loc) · 1.75 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
default_stages: [commit]
repos:
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
hooks:
- id: isort
stages: [ commit ]
args: ["--profile", "black"]
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
stages: [commit]
- repo: https://gitlab.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
stages: [commit]
- repo: https://github.com/pre-commit/pre-commit-hooks
# don't update this beyond 4.0.1 otherwise it stops working on python3.6
rev: v4.0.1
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-merge-conflict
- id: check-yaml
- id: check-toml
- id: mixed-line-ending
stages: [commit]
- repo: local
hooks:
- id: mypy
name: mypy
# Don't mypy if the python version is 3.6 as numpy has no type-stubs
# Don't mypy if the python version is 3.7 as numpy types hints are missing
# on some numpy methods
entry: bash -c "python -c \"import sys; sys.exit(sys.version_info[1]>7)\" || poetry run mypy --strict --non-interactive --install-types src tests"
pass_filenames: false
language: system
types: [python]
- repo: local
hooks:
- id: pylint
name: pylint
entry: poetry run pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
"-dno-else-return", # Disable no-else-return
"-dinvalid-name", # Too many warnings, too difficult to fix
"-dduplicate-code", # Too many false positives
"-dline-too-long", # Black should handle this
]
exclude: |
(?x)^(
tests/.*.py|
docs/.*.py|
scripts/.*.py|
)$