Skip to content

Commit 0560c14

Browse files
onshekukarroum
authored andcommitted
CI: check for numpy.random-related imports (pandas-dev#37117)
1 parent b9c9afe commit 0560c14

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.pre-commit-config.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,17 @@ repos:
6666
from\ pandas\.core\ import\ common|
6767
6868
# Check for imports from collections.abc instead of `from collections import abc`
69-
from\ collections\.abc\ import|
69+
from\ collections\.abc\ import
7070
71-
from\ numpy\ import\ nan
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
7280
types: [python]
7381
- id: non-standard-imports-in-tests
7482
name: Check for non-standard imports in test suite

0 commit comments

Comments
 (0)