@@ -36,7 +36,10 @@ repos:
36
36
rev : 3.9.0
37
37
hooks :
38
38
- id : flake8
39
- additional_dependencies : [flake8-comprehensions>=3.1.0, flake8-bugbear>=21.3.2]
39
+ additional_dependencies :
40
+ - flake8-comprehensions>=3.1.0
41
+ - flake8-bugbear>=21.3.2
42
+ - pandas-dev-flaker==0.1.2
40
43
- id : flake8
41
44
name : flake8 (cython)
42
45
types : [cython]
@@ -69,7 +72,11 @@ repos:
69
72
rev : v1.2.2
70
73
hooks :
71
74
- id : yesqa
72
- additional_dependencies : [flake8==3.9.0]
75
+ additional_dependencies :
76
+ - flake8==3.9.0
77
+ - flake8-comprehensions>=3.1.0
78
+ - flake8-bugbear>=21.3.2
79
+ - pandas-dev-flaker==0.1.2
73
80
- repo : local
74
81
hooks :
75
82
- id : flake8-rst
@@ -80,28 +87,6 @@ repos:
80
87
types : [rst]
81
88
args : [--filename=*.rst]
82
89
additional_dependencies : [flake8-rst==0.7.0, flake8==3.7.9]
83
- - id : frame-or-series-union
84
- name : Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias
85
- entry : Union\[.*(Series,.*DataFrame|DataFrame,.*Series).*\]
86
- language : pygrep
87
- types : [python]
88
- exclude : ^pandas/_typing\.py$
89
- - id : inconsistent-namespace-usage
90
- name : ' Check for inconsistent use of pandas namespace'
91
- entry : python scripts/check_for_inconsistent_pandas_namespace.py
92
- language : python
93
- types : [python]
94
- - id : no-os-remove
95
- name : Check code for instances of os.remove
96
- entry : os\.remove
97
- language : pygrep
98
- types : [python]
99
- files : ^pandas/tests/
100
- exclude : |
101
- (?x)^
102
- pandas/tests/io/excel/test_writers\.py
103
- |pandas/tests/io/pytables/common\.py
104
- |pandas/tests/io/pytables/test_store\.py$
105
90
- id : unwanted-patterns
106
91
name : Unwanted patterns
107
92
language : pygrep
@@ -111,52 +96,10 @@ repos:
111
96
\#\ type:\ (?!ignore)
112
97
|\#\ type:\s?ignore(?!\[)
113
98
114
- # foo._class__ instead of type(foo)
115
- |\.__class__
116
-
117
- # np.bool/np.object instead of np.bool_/np.object_
118
- |np\.bool[^_8]
119
- |np\.object[^_8]
120
-
121
- # imports from pandas.core.common instead of `import pandas.core.common as com`
122
- |from\ pandas\.core\.common\ import
123
- |from\ pandas\.core\ import\ common
124
-
125
- # imports from collections.abc instead of `from collections import abc`
126
- |from\ collections\.abc\ import
127
-
128
- # Numpy
129
- |from\ numpy\ import\ random
130
- |from\ numpy\.random\ import
131
-
132
99
# Incorrect code-block / IPython directives
133
100
|\.\.\ code-block\ ::
134
101
|\.\.\ ipython\ ::
135
102
types_or : [python, cython, rst]
136
- exclude : ^doc/source/development/code_style\.rst # contains examples of patterns to avoid
137
- - id : unwanted-patterns-in-tests
138
- name : Unwanted patterns in tests
139
- language : pygrep
140
- entry : |
141
- (?x)
142
- # pytest.xfail instead of pytest.mark.xfail
143
- pytest\.xfail
144
-
145
- # imports from pandas._testing instead of `import pandas._testing as tm`
146
- |from\ pandas\._testing\ import
147
- |from\ pandas\ import\ _testing\ as\ tm
148
-
149
- # No direct imports from conftest
150
- |conftest\ import
151
- |import\ conftest
152
-
153
- # pandas.testing instead of tm
154
- |pd\.testing\.
155
-
156
- # pd.api.types instead of from pandas.api.types import ...
157
- |(pd|pandas)\.api\.types\.
158
- files : ^pandas/tests/
159
- types_or : [python, cython, rst]
160
103
- id : pip-to-conda
161
104
name : Generate pip dependency from conda
162
105
description : This hook checks if the conda environment.yml and requirements-dev.txt are equal
@@ -178,35 +121,6 @@ repos:
178
121
language : python
179
122
types : [rst]
180
123
files : ^doc/source/(development|reference)/
181
- - id : unwanted-patterns-bare-pytest-raises
182
- name : Check for use of bare pytest raises
183
- language : python
184
- entry : python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
185
- types : [python]
186
- files : ^pandas/tests/
187
- exclude : ^pandas/tests/extension/
188
- - id : unwanted-patterns-private-function-across-module
189
- name : Check for use of private functions across modules
190
- language : python
191
- entry : python scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module"
192
- types : [python]
193
- exclude : ^(asv_bench|pandas/tests|doc)/
194
- - id : unwanted-patterns-private-import-across-module
195
- name : Check for import of private attributes across modules
196
- language : python
197
- entry : python scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module"
198
- types : [python]
199
- exclude : ^(asv_bench|pandas/tests|doc)/
200
- - id : unwanted-patterns-strings-to-concatenate
201
- name : Check for use of not concatenated strings
202
- language : python
203
- entry : python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
204
- types_or : [python, cython]
205
- - id : unwanted-patterns-strings-with-wrong-placed-whitespace
206
- name : Check for strings with wrong placed spaces
207
- language : python
208
- entry : python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
209
- types_or : [python, cython]
210
124
- id : use-pd_array-in-core
211
125
name : Import pandas.array as pd_array in core
212
126
language : python
0 commit comments