@@ -4,46 +4,159 @@ repos:
4
4
hooks :
5
5
- id : black
6
6
- repo : https://gitlab.com/pycqa/flake8
7
- rev : 3.8.3
7
+ rev : 3.8.4
8
8
hooks :
9
9
- id : flake8
10
10
additional_dependencies : [flake8-comprehensions>=3.1.0]
11
11
- id : flake8
12
- name : flake8-pyx
13
- files : \.(pyx|pxd)$
14
- types :
15
- - file
12
+ name : flake8 (cython)
13
+ types : [cython]
16
14
args : [--append-config=flake8/cython.cfg]
17
15
- id : flake8
18
- name : flake8-pxd
16
+ name : flake8 (cython template)
19
17
files : \.pxi\.in$
20
- types :
21
- - file
18
+ types : [text]
22
19
args : [--append-config=flake8/cython-template.cfg]
23
20
- repo : https://github.com/PyCQA/isort
24
- rev : 5.2.2
21
+ rev : 5.6.4
25
22
hooks :
26
23
- id : isort
27
- exclude : ^pandas/__init__\.py$|^pandas/core/api\.py$
24
+ name : isort (python)
25
+ - id : isort
26
+ name : isort (cython)
27
+ types : [cython]
28
28
- repo : https://github.com/asottile/pyupgrade
29
- rev : v2.7.2
29
+ rev : v2.7.3
30
30
hooks :
31
31
- id : pyupgrade
32
32
args : [--py37-plus]
33
33
- repo : https://github.com/pre-commit/pygrep-hooks
34
- rev : v1.6 .0
34
+ rev : v1.7 .0
35
35
hooks :
36
36
- id : rst-backticks
37
+ - id : rst-directive-colons
38
+ types : [text]
39
+ - id : rst-inline-touching-normal
40
+ types : [text]
37
41
- repo : local
38
42
hooks :
39
43
- id : pip_to_conda
40
44
name : Generate pip dependency from conda
41
45
description : This hook checks if the conda environment.yml and requirements-dev.txt are equal
42
- language : system
43
- entry : python -m scripts. generate_pip_deps_from_conda
46
+ language : python
47
+ entry : python scripts/ generate_pip_deps_from_conda.py
44
48
files : ^(environment.yml|requirements-dev.txt)$
45
49
pass_filenames : false
50
+ additional_dependencies : [pyyaml]
51
+ - id : flake8-rst
52
+ name : flake8-rst
53
+ description : Run flake8 on code snippets in docstrings or RST files
54
+ language : python
55
+ entry : flake8-rst
56
+ types : [rst]
57
+ args : [--filename=*.rst]
58
+ additional_dependencies : [flake8-rst==0.7.0, flake8==3.7.9]
59
+ - id : non-standard-imports
60
+ name : Check for non-standard imports
61
+ language : pygrep
62
+ entry : |
63
+ (?x)
64
+ # Check for imports from pandas.core.common instead of `import pandas.core.common as com`
65
+ from\ pandas\.core\.common\ import|
66
+ from\ pandas\.core\ import\ common|
67
+
68
+ # Check for imports from collections.abc instead of `from collections import abc`
69
+ from\ collections\.abc\ import
70
+
71
+ - id : non-standard-numpy.random-related-imports
72
+ name : Check for non-standard numpy.random-related imports excluding pandas/_testing.py
73
+ language : pygrep
74
+ exclude : pandas/_testing.py
75
+ entry : |
76
+ (?x)
77
+ # Check for imports from np.random.<method> instead of `from numpy import random` or `from numpy.random import <method>`
78
+ from\ numpy\ import\ random|
79
+ from\ numpy.random\ import
80
+ types : [python]
81
+ - id : non-standard-imports-in-tests
82
+ name : Check for non-standard imports in test suite
83
+ language : pygrep
84
+ entry : |
85
+ (?x)
86
+ # Check for imports from pandas._testing instead of `import pandas._testing as tm`
87
+ from\ pandas\._testing\ import|
88
+ from\ pandas\ import\ _testing\ as\ tm|
89
+
90
+ # No direct imports from conftest
91
+ conftest\ import|
92
+ import\ conftest
93
+ types : [python]
94
+ files : ^pandas/tests/
95
+ - id : incorrect-code-directives
96
+ name : Check for incorrect code block or IPython directives
97
+ language : pygrep
98
+ entry : (\.\. code-block ::|\.\. ipython ::)
99
+ files : \.(py|pyx|rst)$
100
+ - id : unwanted-patterns-strings-to-concatenate
101
+ name : Check for use of not concatenated strings
102
+ language : python
103
+ entry : python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
104
+ files : \.(py|pyx|pxd|pxi)$
105
+ - id : unwanted-patterns-strings-with-wrong-placed-whitespace
106
+ name : Check for strings with wrong placed spaces
107
+ language : python
108
+ entry : python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
109
+ files : \.(py|pyx|pxd|pxi)$
110
+ - id : unwanted-patterns-private-import-across-module
111
+ name : Check for import of private attributes across modules
112
+ language : python
113
+ entry : python scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module"
114
+ types : [python]
115
+ exclude : ^(asv_bench|pandas/tests|doc)/
116
+ - id : unwanted-patterns-private-function-across-module
117
+ name : Check for use of private functions across modules
118
+ language : python
119
+ entry : python scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module"
120
+ types : [python]
121
+ exclude : ^(asv_bench|pandas/tests|doc)/
122
+ - id : FrameOrSeriesUnion
123
+ name : Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias
124
+ entry : Union\[.*(Series.*DataFrame|DataFrame.*Series).*\]
125
+ language : pygrep
126
+ types : [python]
127
+ exclude : ^pandas/_typing\.py$
128
+ - id : type-not-class
129
+ name : Check for use of foo.__class__ instead of type(foo)
130
+ entry : \.__class__
131
+ language : pygrep
132
+ files : \.(py|pyx)$
133
+ - id : unwanted-typing
134
+ name : Check for use of comment-based annotation syntax and missing error codes
135
+ entry : |
136
+ (?x)
137
+ \#\ type:\ (?!ignore)|
138
+ \#\ type:\s?ignore(?!\[)
139
+ language : pygrep
140
+ types : [python]
141
+ - id : no-os-remove
142
+ name : Check code for instances of os.remove
143
+ entry : os\.remove
144
+ language : pygrep
145
+ types : [python]
146
+ files : ^pandas/tests/
147
+ exclude : |
148
+ (?x)^
149
+ pandas/tests/io/excel/test_writers\.py|
150
+ pandas/tests/io/pytables/common\.py|
151
+ pandas/tests/io/pytables/test_store\.py$
46
152
- repo : https://github.com/asottile/yesqa
47
153
rev : v1.2.2
48
154
hooks :
49
155
- id : yesqa
156
+ - repo : https://github.com/pre-commit/pre-commit-hooks
157
+ rev : v3.3.0
158
+ hooks :
159
+ - id : end-of-file-fixer
160
+ exclude : ^LICENSES/|\.(html|csv|txt|svg|py)$
161
+ - id : trailing-whitespace
162
+ exclude : \.(html|svg)$
0 commit comments