3
3
autoupdate_schedule : quarterly
4
4
5
5
repos :
6
+ - repo : https://github.com/asottile/add-trailing-comma.git
7
+ rev : v2.3.0
8
+ hooks :
9
+ - id : add-trailing-comma
10
+
11
+ - repo : https://github.com/PyCQA/isort.git
12
+ rev : 5.10.1
13
+ hooks :
14
+ - id : isort
15
+ args :
16
+ - --honor-noqa
17
+
6
18
- repo : https://github.com/Lucas-C/pre-commit-hooks.git
7
19
rev : v1.3.1
8
20
hooks :
31
43
- id : trailing-whitespace
32
44
- id : mixed-line-ending
33
45
# Non-modifying checks:
46
+ - id : name-tests-test
47
+ files : >-
48
+ ^tests/[^_].*\.py$
34
49
- id : check-added-large-files
35
50
- id : check-byte-order-marker
36
51
- id : check-case-conflict
@@ -40,6 +55,10 @@ repos:
40
55
- id : check-symlinks
41
56
- id : check-yaml
42
57
- id : detect-private-key
58
+ # Heavy checks:
59
+ - id : check-ast
60
+ - id : debug-statements
61
+ language_version : python3
43
62
44
63
- repo : https://github.com/codespell-project/codespell
45
64
rev : v2.2.1
@@ -57,4 +76,106 @@ repos:
57
76
args :
58
77
- --strict
59
78
79
+ - repo : https://github.com/PyCQA/flake8.git
80
+ rev : 6.0.0
81
+ hooks :
82
+ - id : flake8
83
+ alias : flake8-no-wps
84
+ name : flake8 WPS-excluded
85
+ args :
86
+ - --ignore
87
+ - >-
88
+ D100,
89
+ D101,
90
+ D103,
91
+ D107,
92
+ E402,
93
+ E501,
94
+ additional_dependencies :
95
+ - flake8-2020 ~= 1.7.0
96
+ - flake8-pytest-style ~= 1.6.0
97
+ language_version : python3
98
+
99
+ - repo : https://github.com/PyCQA/flake8.git
100
+ # NOTE: This is kept at v4 for until WPS starts supporting flake v5.
101
+ rev : 4.0.1 # enforce-version: 4.0.1
102
+ hooks :
103
+ - id : flake8
104
+ alias : flake8-only-wps
105
+ name : flake8 WPS-only
106
+ args :
107
+ - --ignore
108
+ - >-
109
+ WPS102,
110
+ WPS110,
111
+ WPS111,
112
+ WPS305,
113
+ WPS347,
114
+ WPS360,
115
+ WPS421,
116
+ WPS422,
117
+ WPS432,
118
+ WPS433,
119
+ WPS437,
120
+ WPS440,
121
+ WPS441,
122
+ WPS453,
123
+ - --select
124
+ - WPS
125
+ additional_dependencies :
126
+ - wemake-python-styleguide ~= 0.16.1
127
+ language_version : python3
128
+
129
+ - repo : https://github.com/PyCQA/pylint.git
130
+ rev : v2.15.3
131
+ hooks :
132
+ - id : pylint
133
+ args :
134
+ - --disable
135
+ - >-
136
+ import-error,
137
+ invalid-name,
138
+ line-too-long,
139
+ missing-class-docstring,
140
+ missing-function-docstring,
141
+ missing-module-docstring,
142
+ protected-access,
143
+ super-init-not-called,
144
+ unused-argument,
145
+ wrong-import-position,
146
+ - --output-format
147
+ - colorized
148
+
149
+ - repo : local
150
+ hooks :
151
+ - id : enforced-flake8-version
152
+ name : Verify that enforced flake8 version stays unchanged
153
+ description : >-
154
+ This is a sanity check and fixer that makes sure that
155
+ the `flake8` version in this file remains matching the
156
+ corresponding request in the `# enforce-version` comment.
157
+ # Using Python here because using
158
+ # shell test does not always work in CIs:
159
+ entry : >-
160
+ python -c 'import pathlib, re, sys;
161
+ pre_commit_config = pathlib.Path(sys.argv[1]);
162
+ cfg_txt = pre_commit_config.read_text();
163
+ new_cfg_txt = re.sub(
164
+ r"(?P<spaces>\s+)rev:\s(?:\d+\.\d+\.\d+)\s{0,2}"
165
+ r"#\senforce-version:\s(?P<enforced_version>\d+\.\d+\.\d+)"
166
+ r"[ \t\f\v]*",
167
+ r"\g<spaces>rev: \g<enforced_version> "
168
+ r"# enforce-version: \g<enforced_version>",
169
+ cfg_txt,
170
+ );
171
+ cfg_txt != new_cfg_txt and
172
+ pre_commit_config.write_text(new_cfg_txt)
173
+ '
174
+ pass_filenames : true
175
+ language : system
176
+ files : >-
177
+ ^\.pre-commit-config\.ya?ml$
178
+ types :
179
+ - yaml
180
+
60
181
...
0 commit comments