Skip to content

CI: check for numpy.random-related imports #37117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,17 @@ repos:
from\ pandas\.core\ import\ common|

# Check for imports from collections.abc instead of `from collections import abc`
from\ collections\.abc\ import|
from\ collections\.abc\ import

from\ numpy\ import\ nan
- id: non-standard-numpy.random-related-imports
name: Check for non-standard numpy.random-related imports excluding pandas/_testing.py
language: pygrep
exclude: pandas/_testing.py
entry: |
(?x)
# Check for imports from np.random.<method> instead of `from numpy import random` or `from numpy.random import <method>`
from\ numpy\ import\ random|
from\ numpy.random\ import
types: [python]
- id: non-standard-imports-in-tests
name: Check for non-standard imports in test suite
Expand Down