1
1
minimum_pre_commit_version : 2.9.2
2
2
exclude : ^LICENSES/|\.(html|csv|svg)$
3
+ ci :
4
+ autofix_prs : false
3
5
repos :
4
6
- repo : https://github.com/MarcoGorelli/absolufy-imports
5
7
rev : v0.3.0
@@ -33,10 +35,13 @@ repos:
33
35
exclude : ^pandas/_libs/src/(klib|headers)/
34
36
args : [--quiet, '--extensions=c,h', '--headers=h', --recursive, '--filter=-readability/casting,-runtime/int,-build/include_subdir']
35
37
- repo : https://gitlab.com/pycqa/flake8
36
- rev : 3.9.0
38
+ rev : 3.9.1
37
39
hooks :
38
40
- id : flake8
39
- 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
40
45
- id : flake8
41
46
name : flake8 (cython)
42
47
types : [cython]
@@ -51,10 +56,10 @@ repos:
51
56
hooks :
52
57
- id : isort
53
58
- repo : https://github.com/asottile/pyupgrade
54
- rev : v2.11 .0
59
+ rev : v2.12 .0
55
60
hooks :
56
61
- id : pyupgrade
57
- args : [--py37-plus, --keep-runtime-typing ]
62
+ args : [--py37-plus]
58
63
- repo : https://github.com/pre-commit/pygrep-hooks
59
64
rev : v1.8.0
60
65
hooks :
@@ -69,6 +74,11 @@ repos:
69
74
rev : v1.2.2
70
75
hooks :
71
76
- id : yesqa
77
+ additional_dependencies :
78
+ - flake8==3.9.1
79
+ - flake8-comprehensions==3.1.0
80
+ - flake8-bugbear==21.3.2
81
+ - pandas-dev-flaker==0.2.0
72
82
- repo : local
73
83
hooks :
74
84
- id : flake8-rst
@@ -79,76 +89,18 @@ repos:
79
89
types : [rst]
80
90
args : [--filename=*.rst]
81
91
additional_dependencies : [flake8-rst==0.7.0, flake8==3.7.9]
82
- - id : frame-or-series-union
83
- name : Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias
84
- entry : Union\[.*(Series,.*DataFrame|DataFrame,.*Series).*\]
85
- language : pygrep
86
- types : [python]
87
- exclude : ^pandas/_typing\.py$
88
- - id : inconsistent-namespace-usage
89
- name : ' Check for inconsistent use of pandas namespace'
90
- entry : python scripts/check_for_inconsistent_pandas_namespace.py
91
- language : python
92
- types : [python]
93
- - id : incorrect-code-directives
94
- name : Check for incorrect code block or IPython directives
95
- language : pygrep
96
- entry : (\.\. code-block ::|\.\. ipython ::)
97
- types_or : [python, cython, rst]
98
- - id : no-os-remove
99
- name : Check code for instances of os.remove
100
- entry : os\.remove
101
- language : pygrep
102
- types : [python]
103
- files : ^pandas/tests/
104
- exclude : |
105
- (?x)^
106
- pandas/tests/io/excel/test_writers\.py
107
- |pandas/tests/io/pytables/common\.py
108
- |pandas/tests/io/pytables/test_store\.py$
109
- - id : non-standard-imports
110
- name : Check for non-standard imports
111
- language : pygrep
112
- entry : |
113
- (?x)
114
- # Check for imports from pandas.core.common instead of `import pandas.core.common as com`
115
- from\ pandas\.core\.common\ import
116
- |from\ pandas\.core\ import\ common
117
-
118
- # Check for imports from collections.abc instead of `from collections import abc`
119
- |from\ collections\.abc\ import
120
-
121
- # Numpy
122
- |from\ numpy\ import\ random
123
- |from\ numpy\.random\ import
124
- types : [python]
125
- - id : non-standard-imports-in-tests
126
- name : Check for non-standard imports in test suite
92
+ - id : unwanted-patterns
93
+ name : Unwanted patterns
127
94
language : pygrep
128
95
entry : |
129
96
(?x)
130
- # Check for imports from pandas._testing instead of `import pandas._testing as tm`
131
- from\ pandas\._testing\ import
132
- |from\ pandas\ import\ _testing\ as\ tm
133
-
134
- # No direct imports from conftest
135
- |conftest\ import
136
- |import\ conftest
137
-
138
- # Check for use of pandas.testing instead of tm
139
- |pd\.testing\.
97
+ # outdated annotation syntax, missing error codes
98
+ \#\ type:\ (?!ignore)
99
+ |\#\ type:\s?ignore(?!\[)
140
100
141
- # Check for pd.api.types instead of from pandas.api.types import ...
142
- |(pd|pandas)\.api\.types\.
143
- types : [python]
144
- files : ^pandas/tests/
145
- - id : np-bool-and-np-object
146
- name : Check for use of np.bool/np.object instead of np.bool_/np.object_
147
- entry : |
148
- (?x)
149
- np\.bool[^_8]
150
- |np\.object[^_8]
151
- language : pygrep
101
+ # Incorrect code-block / IPython directives
102
+ |\.\.\ code-block\ ::
103
+ |\.\.\ ipython\ ::
152
104
types_or : [python, cython, rst]
153
105
- id : pip-to-conda
154
106
name : Generate pip dependency from conda
@@ -158,64 +110,28 @@ repos:
158
110
files : ^(environment.yml|requirements-dev.txt)$
159
111
pass_filenames : false
160
112
additional_dependencies : [pyyaml]
113
+ - id : sync-flake8-versions
114
+ name : Check flake8 version is synced across flake8, yesqa, and environment.yml
115
+ language : python
116
+ entry : python scripts/sync_flake8_versions.py
117
+ files : ^(\.pre-commit-config\.yaml|environment\.yml)$
118
+ pass_filenames : false
119
+ additional_dependencies : [pyyaml]
161
120
- id : title-capitalization
162
121
name : Validate correct capitalization among titles in documentation
163
122
entry : python scripts/validate_rst_title_capitalization.py
164
123
language : python
165
124
types : [rst]
166
125
files : ^doc/source/(development|reference)/
167
- - id : type-not-class
168
- name : Check for use of foo.__class__ instead of type(foo)
169
- entry : \.__class__
170
- language : pygrep
171
- types_or : [python, cython]
172
- - id : unwanted-patterns-bare-pytest-raises
173
- name : Check for use of bare pytest raises
174
- language : python
175
- entry : python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
176
- types : [python]
177
- files : ^pandas/tests/
178
- exclude : ^pandas/tests/extension/
179
- - id : unwanted-patterns-private-function-across-module
180
- name : Check for use of private functions across modules
181
- language : python
182
- entry : python scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module"
183
- types : [python]
184
- exclude : ^(asv_bench|pandas/tests|doc)/
185
- - id : unwanted-patterns-private-import-across-module
186
- name : Check for import of private attributes across modules
187
- language : python
188
- entry : python scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module"
189
- types : [python]
190
- exclude : ^(asv_bench|pandas/tests|doc)/
191
- - id : unwanted-patterns-pytest-xfail
192
- name : Check for use of pytest.xfail
193
- entry : pytest\.xfail
194
- language : pygrep
195
- types : [python]
196
- files : ^pandas/tests/
197
- - id : unwanted-patterns-strings-to-concatenate
198
- name : Check for use of not concatenated strings
199
- language : python
200
- entry : python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
201
- types_or : [python, cython]
202
- - id : unwanted-patterns-strings-with-wrong-placed-whitespace
203
- name : Check for strings with wrong placed spaces
204
- language : python
205
- entry : python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
206
- types_or : [python, cython]
207
- - id : unwanted-typing
208
- name : Check for outdated annotation syntax and missing error codes
209
- entry : |
210
- (?x)
211
- \#\ type:\ (?!ignore)
212
- |\#\ type:\s?ignore(?!\[)
213
- language : pygrep
214
- types : [python]
215
126
- id : use-pd_array-in-core
216
127
name : Import pandas.array as pd_array in core
217
128
language : python
218
129
entry : python scripts/use_pd_array_in_core.py
219
130
files : ^pandas/core/
220
131
exclude : ^pandas/core/api\.py$
221
132
types : [python]
133
+ - id : no-bool-in-core-generic
134
+ name : Use bool_t instead of bool in pandas/core/generic.py
135
+ entry : python scripts/no_bool_in_generic.py
136
+ language : python
137
+ files : ^pandas/core/generic\.py$
0 commit comments