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