@@ -24,12 +24,12 @@ repos:
24
24
hooks :
25
25
- id : isort
26
26
- repo : https://github.com/asottile/pyupgrade
27
- rev : v2.7.4
27
+ rev : v2.10.0
28
28
hooks :
29
29
- id : pyupgrade
30
- args : [--py37-plus]
30
+ args : [--py37-plus, --keep-runtime-typing ]
31
31
- repo : https://github.com/pre-commit/pygrep-hooks
32
- rev : v1.7.0
32
+ rev : v1.7.1
33
33
hooks :
34
34
- id : rst-backticks
35
35
- id : rst-directive-colons
@@ -60,11 +60,11 @@ repos:
60
60
entry : |
61
61
(?x)
62
62
# Check for imports from pandas.core.common instead of `import pandas.core.common as com`
63
- from\ pandas\.core\.common\ import|
64
- from\ pandas\.core\ import\ common|
63
+ from\ pandas\.core\.common\ import
64
+ | from\ pandas\.core\ import\ common
65
65
66
66
# Check for imports from collections.abc instead of `from collections import abc`
67
- from\ collections\.abc\ import
67
+ | from\ collections\.abc\ import
68
68
69
69
- id : non-standard-numpy.random-related-imports
70
70
name : Check for non-standard numpy.random-related imports excluding pandas/_testing.py
@@ -73,24 +73,24 @@ repos:
73
73
entry : |
74
74
(?x)
75
75
# Check for imports from np.random.<method> instead of `from numpy import random` or `from numpy.random import <method>`
76
- from\ numpy\ import\ random|
77
- from\ numpy.random\ import
76
+ from\ numpy\ import\ random
77
+ | from\ numpy.random\ import
78
78
types : [python]
79
79
- id : non-standard-imports-in-tests
80
80
name : Check for non-standard imports in test suite
81
81
language : pygrep
82
82
entry : |
83
83
(?x)
84
84
# Check for imports from pandas._testing instead of `import pandas._testing as tm`
85
- from\ pandas\._testing\ import|
86
- from\ pandas\ import\ _testing\ as\ tm|
85
+ from\ pandas\._testing\ import
86
+ | from\ pandas\ import\ _testing\ as\ tm
87
87
88
88
# No direct imports from conftest
89
- conftest\ import|
90
- import\ conftest
89
+ | conftest\ import
90
+ | import\ conftest
91
91
92
92
# Check for use of pandas.testing instead of tm
93
- pd\.testing\.
93
+ | pd\.testing\.
94
94
types : [python]
95
95
files : ^pandas/tests/
96
96
- id : incorrect-code-directives
@@ -127,6 +127,12 @@ repos:
127
127
types : [python]
128
128
files : ^pandas/tests/
129
129
exclude : ^pandas/tests/extension/
130
+ - id : unwanted-patters-pytest-xfail
131
+ name : Check for use of pytest.xfail
132
+ entry : pytest\.xfail
133
+ language : pygrep
134
+ types : [python]
135
+ files : ^pandas/tests/
130
136
- id : inconsistent-namespace-usage
131
137
name : ' Check for inconsistent use of pandas namespace in tests'
132
138
entry : python scripts/check_for_inconsistent_pandas_namespace.py
@@ -135,7 +141,7 @@ repos:
135
141
files : ^pandas/tests/
136
142
- id : FrameOrSeriesUnion
137
143
name : Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias
138
- entry : Union\[.*(Series.*DataFrame|DataFrame.*Series).*\]
144
+ entry : Union\[.*(Series, .*DataFrame|DataFrame, .*Series).*\]
139
145
language : pygrep
140
146
types : [python]
141
147
exclude : ^pandas/_typing\.py$
@@ -148,9 +154,8 @@ repos:
148
154
name : Check for outdated annotation syntax and missing error codes
149
155
entry : |
150
156
(?x)
151
- \#\ type:\ (?!ignore)|
152
- \#\ type:\s?ignore(?!\[)|
153
- \)\ ->\ \"
157
+ \#\ type:\ (?!ignore)
158
+ |\#\ type:\s?ignore(?!\[)
154
159
language : pygrep
155
160
types : [python]
156
161
- id : np-bool
@@ -166,9 +171,15 @@ repos:
166
171
files : ^pandas/tests/
167
172
exclude : |
168
173
(?x)^
169
- pandas/tests/io/excel/test_writers\.py|
170
- pandas/tests/io/pytables/common\.py|
171
- pandas/tests/io/pytables/test_store\.py$
174
+ pandas/tests/io/excel/test_writers\.py
175
+ |pandas/tests/io/pytables/common\.py
176
+ |pandas/tests/io/pytables/test_store\.py$
177
+ - id : no-pandas-api-types
178
+ name : Check code for instances of pd.api.types
179
+ entry : (pd|pandas)\.api\.types\.
180
+ language : pygrep
181
+ types : [python]
182
+ files : ^pandas/tests/
172
183
- repo : https://github.com/asottile/yesqa
173
184
rev : v1.2.2
174
185
hooks :
@@ -184,4 +195,14 @@ repos:
184
195
hooks :
185
196
- id : codespell
186
197
types_or : [python, rst, markdown]
187
- files : ^pandas/core/
198
+ files : ^pandas/
199
+ exclude : ^pandas/tests/
200
+ - repo : https://github.com/MarcoGorelli/no-string-hints
201
+ rev : v0.1.7
202
+ hooks :
203
+ - id : no-string-hints
204
+ - repo : https://github.com/MarcoGorelli/abs-imports
205
+ rev : v0.1.2
206
+ hooks :
207
+ - id : abs-imports
208
+ files : ^pandas/
0 commit comments