-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
107 lines (91 loc) · 3.14 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
repos:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.5.4
hooks:
- id: autopep8
description: "Applies a subset of autopep8's fixes to Python code"
args:
- --in-place
# enable max aggresiveness because all the errors are hand picked
- -aaa
- --max-line-length
- "100"
- --select
# autopep8 is used for structure rather than style here, which is why only a few error codes are
# selected
- W292,E502,E266,E402,E713,E714,E721,E722,E731
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
description: "Runs black over Python code"
args: ["--target-version", "py38", "--line-length", "100"]
- repo: https://github.com/myint/docformatter
rev: v1.3.1
hooks:
- id: docformatter
name: docformatter
description: 'Formats docstrings to follow PEP 257.'
entry: docformatter
language: python
- repo: https://github.com/PyCQA/pydocstyle.git
rev: 5.1.1
hooks:
- id: pydocstyle
name: pydocstyle
description: "Runs pydocstyle over Python code"
entry: pydocstyle
language: python
language_version: python3
exclude: "setup.py"
types: [python]
# -e enables more verbose explainations of errors
args: ["-e", "--convention=numpy", "--add-ignore", "D100,D101,D102,D103,D104,D105,D106,D107"]
- repo: https://github.com/humitos/mirrors-autoflake
rev: v1.3
hooks:
- id: autoflake
name: autoflake
description: "Runs autoflake over Python code"
entry: autoflake
language: python
language_version: python3
types: [python]
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports", "--remove-duplicate-keys", "--exclude", "__init__.py"]
- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
hooks:
- id: flake8
name: flake8
description: "Runs flake8 over Python code"
entry: flake8
language: python
language_version: python3
types: [python]
# http://flake8.pycqa.org/en/latest/user/error-codes.html
# F631 assertion test is a tuple, which are always True
# F721 doctest syntax error
# F821 undefined name
# F822 undefined name in __all__
# F823 local variable name … referenced before assignment
# F901 raise NotImplemented should be raise NotImplementedError
# "We also report one extra error: E999. We report E999 when we fail to compile a file into an
# Abstract Syntax Tree for the plugins that require it."
args: ["--select=F631,F721,F821,F822,F823,E901,E999"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
hooks:
- id: mypy
description: "Runs mypy over Python code"
args:
- "--disallow-untyped-defs"
- "--no-implicit-optional"
- "--ignore-missing-imports"
- "--warn-redundant-casts"
- "--warn-unused-ignores"
- "--show-error-context"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-json
- id: trailing-whitespace