@@ -46,14 +46,22 @@ repos:
46
46
- repo : https://github.com/pre-commit/pre-commit-hooks
47
47
rev : v4.4.0
48
48
hooks :
49
+ - id : check-ast
50
+ - id : check-case-conflict
51
+ - id : check-toml
52
+ - id : check-xml
53
+ - id : check-yaml
54
+ exclude : ^ci/meta.yaml$
49
55
- id : debug-statements
50
56
- id : end-of-file-fixer
51
57
exclude : \.txt$
52
- stages : [commit, merge-commit, push, prepare-commit-msg, commit-msg,
53
- post-checkout, post-commit, post-merge, post-rewrite]
58
+ - id : mixed-line-ending
59
+ args : [--fix=auto]
60
+ exclude : ^pandas/tests/io/parser/data/utf16_ex.txt$
61
+ - id : fix-byte-order-marker
62
+ - id : fix-encoding-pragma
63
+ args : [--remove]
54
64
- id : trailing-whitespace
55
- stages : [commit, merge-commit, push, prepare-commit-msg, commit-msg,
56
- post-checkout, post-commit, post-merge, post-rewrite]
57
65
- repo : https://github.com/cpplint/cpplint
58
66
rev : 1.6.1
59
67
hooks :
@@ -98,6 +106,8 @@ repos:
98
106
- repo : https://github.com/pre-commit/pygrep-hooks
99
107
rev : v1.10.0
100
108
hooks :
109
+ - id : python-check-blanket-noqa
110
+ - id : python-check-blanket-type-ignore
101
111
- id : rst-backticks
102
112
- id : rst-directive-colons
103
113
types : [text] # overwrite types: [rst]
@@ -154,31 +164,17 @@ repos:
154
164
exclude : ^pandas/core/interchange/
155
165
language : python
156
166
types : [python]
157
- - id : no-os-remove
158
- name : Check code for instances of os.remove
159
- entry : os\.remove
160
- language : pygrep
161
- types : [python]
162
- files : ^pandas/tests/
163
- exclude : |
164
- (?x)^
165
- pandas/tests/io/pytables/test_store\.py$
166
167
- id : unwanted-patterns
167
168
name : Unwanted patterns
168
169
language : pygrep
169
170
entry : |
170
171
(?x)
171
- # outdated annotation syntax, missing error codes
172
+ # outdated annotation syntax
172
173
\#\ type:\ (?!ignore)
173
- |\#\ type:\s?ignore(?!\[)
174
174
175
175
# foo._class__ instead of type(foo)
176
176
|\.__class__
177
177
178
- # np.bool/np.object instead of np.bool_/np.object_
179
- |np\.bool[^_8`]
180
- |np\.object[^_8`]
181
-
182
178
# Numpy
183
179
|from\ numpy\ import\ random
184
180
|from\ numpy\.random\ import
@@ -197,16 +193,8 @@ repos:
197
193
198
194
# builtin filter function
199
195
|(?<!def)[\(\s]filter\(
200
-
201
- # exec
202
- |[^a-zA-Z0-9_]exec\(
203
196
types_or : [python, cython, rst]
204
197
exclude : ^doc/source/development/code_style\.rst # contains examples of patterns to avoid
205
- - id : cython-casting
206
- name : Check Cython casting is `<type>obj`, not `<type> obj`
207
- language : pygrep
208
- entry : ' [a-zA-Z0-9*]> '
209
- files : (\.pyx|\.pxi.in)$
210
198
- id : incorrect-backticks
211
199
name : Check for backticks incorrectly rendering because of missing spaces
212
200
language : pygrep
@@ -219,19 +207,6 @@ repos:
219
207
entry : ' np\.random\.seed'
220
208
files : ^asv_bench/benchmarks
221
209
exclude : ^asv_bench/benchmarks/pandas_vb_common\.py
222
- - id : np-testing-array-equal
223
- name : Check for usage of numpy testing or array_equal
224
- language : pygrep
225
- entry : ' (numpy|np)(\.testing|\.array_equal)'
226
- files : ^pandas/tests/
227
- types : [python]
228
- - id : invalid-ea-testing
229
- name : Check for invalid EA testing
230
- language : pygrep
231
- entry : ' tm\.assert_(series|frame)_equal'
232
- files : ^pandas/tests/extension/base
233
- types : [python]
234
- exclude : ^pandas/tests/extension/base/base\.py
235
210
- id : unwanted-patterns-in-tests
236
211
name : Unwanted patterns in tests
237
212
language : pygrep
@@ -265,6 +240,9 @@ repos:
265
240
266
241
# pytest.warns (use tm.assert_produces_warning instead)
267
242
|pytest\.warns
243
+
244
+ # os.remove
245
+ |os\.remove
268
246
files : ^pandas/tests/
269
247
types_or : [python, cython, rst]
270
248
- id : unwanted-patterns-in-ea-tests
0 commit comments