@@ -56,12 +56,44 @@ repos:
56
56
- id : incorrect-sphinx-directives
57
57
name : Check for incorrect Sphinx directives
58
58
language : pygrep
59
- entry : >-
60
- \.\. (autosummary|contents|currentmodule|deprecated
61
- |function|image|important|include|ipython|literalinclude
62
- |math|module|note|raw|seealso|toctree|versionadded
63
- |versionchanged|warning):[^:]
59
+ entry : |
60
+ (?x)
61
+ # Check for cases of e.g. .. warning: instead of .. warning::
62
+ \.\.\ (
63
+ autosummary|contents|currentmodule|deprecated|
64
+ function|image|important|include|ipython|literalinclude|
65
+ math|module|note|raw|seealso|toctree|versionadded|
66
+ versionchanged|warning
67
+ ):[^:]
64
68
files : \.(py|pyx|rst)$
69
+ - id : non-standard-imports
70
+ name : Check for non-standard imports
71
+ language : pygrep
72
+ entry : |
73
+ (?x)
74
+ # Check for imports from pandas.core.common instead of `import pandas.core.common as com`
75
+ from\ pandas\.core\.common\ import|
76
+ from\ pandas\.core\ import\ common|
77
+
78
+ # Check for imports from collections.abc instead of `from collections import abc`
79
+ from\ collections\.abc\ import|
80
+
81
+ from\ numpy\ import\ nan
82
+ types : [python]
83
+ - id : non-standard-imports-in-tests
84
+ name : Check for non-standard imports in test suite
85
+ language : pygrep
86
+ entry : |
87
+ (?x)
88
+ # Check for imports from pandas._testing instead of `import pandas._testing as tm`
89
+ from\ pandas\._testing\ import|
90
+ from\ pandas\ import\ _testing\ as\ tm|
91
+
92
+ # No direct imports from conftest
93
+ conftest\ import|
94
+ import\ conftest
95
+ types : [python]
96
+ files : ^pandas/tests/
65
97
- id : incorrect-code-directives
66
98
name : Check for incorrect code block or IPython directives
67
99
language : pygrep
0 commit comments