@@ -15,20 +15,13 @@ default_stages: [
1515ci :
1616 autofix_prs : false
1717repos :
18- - repo : local
18+ - repo : https://github.com/hauntsaninja/black-pre-commit-mirror
19+ # black compiled with mypyc
20+ rev : 23.3.0
1921 hooks :
20- # NOTE: we make `black` a local hook because if it's installed from
21- # PyPI (rather than from source) then it'll run twice as fast thanks to mypyc
22- - id : black
23- name : black
24- description : " Black: The uncompromising Python code formatter"
25- entry : black
26- language : python
27- require_serial : true
28- types_or : [python, pyi]
29- additional_dependencies : [black==23.3.0]
30- - repo : https://github.com/charliermarsh/ruff-pre-commit
31- rev : v0.0.270
22+ - id : black
23+ - repo : https://github.com/astral-sh/ruff-pre-commit
24+ rev : v0.0.277
3225 hooks :
3326 - id : ruff
3427 args : [--exit-non-zero-on-fix]
4033 pass_filenames : true
4134 require_serial : false
4235- repo : https://github.com/codespell-project/codespell
43- rev : v2.2.4
36+ rev : v2.2.5
4437 hooks :
4538 - id : codespell
4639 types_or : [python, rst, markdown, cython, c]
@@ -53,14 +46,22 @@ repos:
5346- repo : https://github.com/pre-commit/pre-commit-hooks
5447 rev : v4.4.0
5548 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$
5655 - id : debug-statements
5756 - id : end-of-file-fixer
5857 exclude : \.txt$
59- stages : [commit, merge-commit, push, prepare-commit-msg, commit-msg,
60- 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]
6164 - id : trailing-whitespace
62- stages : [commit, merge-commit, push, prepare-commit-msg, commit-msg,
63- post-checkout, post-commit, post-merge, post-rewrite]
6465- repo : https://github.com/cpplint/cpplint
6566 rev : 1.6.1
6667 hooks :
7475 --linelength=88,
7576 ' --filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
7677 ]
77- - repo : https://github.com/pycqa /pylint
78+ - repo : https://github.com/pylint-dev /pylint
7879 rev : v3.0.0a6
7980 hooks :
8081 - id : pylint
@@ -93,23 +94,20 @@ repos:
9394 |^pandas/conftest\.py # keep excluded
9495 args : [--disable=all, --enable=redefined-outer-name]
9596 stages : [manual]
96- - id : pylint
97- alias : unspecified-encoding
98- name : Using open without explicitly specifying an encoding
99- args : [--disable=all, --enable=unspecified-encoding]
100- stages : [manual]
10197- repo : https://github.com/PyCQA/isort
10298 rev : 5.12.0
10399 hooks :
104100 - id : isort
105101- repo : https://github.com/asottile/pyupgrade
106- rev : v3.4 .0
102+ rev : v3.7 .0
107103 hooks :
108104 - id : pyupgrade
109- args : [--py38 -plus]
105+ args : [--py39 -plus]
110106- repo : https://github.com/pre-commit/pygrep-hooks
111107 rev : v1.10.0
112108 hooks :
109+ - id : python-check-blanket-noqa
110+ - id : python-check-blanket-type-ignore
113111 - id : rst-backticks
114112 - id : rst-directive-colons
115113 types : [text] # overwrite types: [rst]
@@ -132,7 +130,7 @@ repos:
132130 types : [python]
133131 stages : [manual]
134132 additional_dependencies : &pyright_dependencies
135- 133+ 136134 - id : pyright_reportGeneralTypeIssues
137135 # note: assumes python env is setup and activated
138136 name : pyright reportGeneralTypeIssues
@@ -166,34 +164,17 @@ repos:
166164 exclude : ^pandas/core/interchange/
167165 language : python
168166 types : [python]
169- - id : no-os-remove
170- name : Check code for instances of os.remove
171- entry : os\.remove
172- language : pygrep
173- types : [python]
174- files : ^pandas/tests/
175- exclude : |
176- (?x)^
177- pandas/tests/io/pytables/test_store\.py$
178167 - id : unwanted-patterns
179168 name : Unwanted patterns
180169 language : pygrep
181170 entry : |
182171 (?x)
183- # outdated annotation syntax, missing error codes
172+ # outdated annotation syntax
184173 \#\ type:\ (?!ignore)
185- |\#\ type:\s?ignore(?!\[)
186174
187175 # foo._class__ instead of type(foo)
188176 |\.__class__
189177
190- # np.bool/np.object instead of np.bool_/np.object_
191- |np\.bool[^_8`]
192- |np\.object[^_8`]
193-
194- # imports from collections.abc instead of `from collections import abc`
195- |from\ collections\.abc\ import
196-
197178 # Numpy
198179 |from\ numpy\ import\ random
199180 |from\ numpy\.random\ import
@@ -212,16 +193,8 @@ repos:
212193
213194 # builtin filter function
214195 |(?<!def)[\(\s]filter\(
215-
216- # exec
217- |[^a-zA-Z0-9_]exec\(
218196 types_or : [python, cython, rst]
219197 exclude : ^doc/source/development/code_style\.rst # contains examples of patterns to avoid
220- - id : cython-casting
221- name : Check Cython casting is `<type>obj`, not `<type> obj`
222- language : pygrep
223- entry : ' [a-zA-Z0-9*]> '
224- files : (\.pyx|\.pxi.in)$
225198 - id : incorrect-backticks
226199 name : Check for backticks incorrectly rendering because of missing spaces
227200 language : pygrep
@@ -234,19 +207,6 @@ repos:
234207 entry : ' np\.random\.seed'
235208 files : ^asv_bench/benchmarks
236209 exclude : ^asv_bench/benchmarks/pandas_vb_common\.py
237- - id : np-testing-array-equal
238- name : Check for usage of numpy testing or array_equal
239- language : pygrep
240- entry : ' (numpy|np)(\.testing|\.array_equal)'
241- files : ^pandas/tests/
242- types : [python]
243- - id : invalid-ea-testing
244- name : Check for invalid EA testing
245- language : pygrep
246- entry : ' tm\.assert_(series|frame)_equal'
247- files : ^pandas/tests/extension/base
248- types : [python]
249- exclude : ^pandas/tests/extension/base/base\.py
250210 - id : unwanted-patterns-in-tests
251211 name : Unwanted patterns in tests
252212 language : pygrep
@@ -280,6 +240,9 @@ repos:
280240
281241 # pytest.warns (use tm.assert_produces_warning instead)
282242 |pytest\.warns
243+
244+ # os.remove
245+ |os\.remove
283246 files : ^pandas/tests/
284247 types_or : [python, cython, rst]
285248 - id : unwanted-patterns-in-ea-tests
0 commit comments