@@ -50,10 +50,6 @@ repos:
5050 rev : 5.7.0
5151 hooks :
5252 - id : isort
53- - repo : https://github.com/MarcoGorelli/no-string-hints
54- rev : v0.1.7
55- hooks :
56- - id : no-string-hints
5753- repo : https://github.com/asottile/pyupgrade
5854 rev : v2.10.0
5955 hooks :
@@ -111,12 +107,6 @@ repos:
111107 pandas/tests/io/excel/test_writers\.py
112108 |pandas/tests/io/pytables/common\.py
113109 |pandas/tests/io/pytables/test_store\.py$
114- - id : no-pandas-api-types
115- name : Check code for instances of pd.api.types
116- entry : (pd|pandas)\.api\.types\.
117- language : pygrep
118- types : [python]
119- files : ^pandas/tests/
120110 - id : non-standard-imports
121111 name : Check for non-standard imports
122112 language : pygrep
@@ -128,6 +118,11 @@ repos:
128118
129119 # Check for imports from collections.abc instead of `from collections import abc`
130120 |from\ collections\.abc\ import
121+
122+ # Numpy
123+ |from\ numpy\ import\ random
124+ |from\ numpy\.random\ import
125+ types : [python]
131126 - id : non-standard-imports-in-tests
132127 name : Check for non-standard imports in test suite
133128 language : pygrep
@@ -143,26 +138,17 @@ repos:
143138
144139 # Check for use of pandas.testing instead of tm
145140 |pd\.testing\.
141+
142+ # Check for pd.api.types instead of from pandas.api.types import ...
143+ |(pd|pandas)\.api\.types\.
146144 types : [python]
147145 files : ^pandas/tests/
148- - id : non-standard-numpy-random-related-imports
149- name : Check for non-standard numpy.random-related imports excluding pandas/_testing.py
150- language : pygrep
151- exclude : pandas/_testing.py
146+ - id : np-bool-and-np-object
147+ name : Check for use of np.bool/np.object instead of np.bool_/np.object_
152148 entry : |
153149 (?x)
154- # Check for imports from np.random.<method> instead of `from numpy import random` or `from numpy.random import <method>`
155- from\ numpy\ import\ random
156- |from\ numpy.random\ import
157- types : [python]
158- - id : np-bool
159- name : Check for use of np.bool instead of np.bool_
160- entry : np\.bool[^_8]
161- language : pygrep
162- types_or : [python, cython, rst]
163- - id : np-object
164- name : Check for use of np.object instead of np.object_
165- entry : np\.object[^_8]
150+ np\.bool[^_8]
151+ |np\.object[^_8]
166152 language : pygrep
167153 types_or : [python, cython, rst]
168154 - id : pip-to-conda
0 commit comments