8000 CI move non-standard-import checks over to pre-commit by MarcoGorelli · Pull Request #37240 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

CI move non-standard-import checks over to pre-commit #37240

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
merged 7 commits into from
Oct 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comments
  • Loading branch information
Marco Gorelli committed Oct 21, 2020
commit d414d7b1075e3ff843593b0ce77cee4313afba87
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ repos:
name: Check for incorrect Sphinx directives
language: pygrep
entry: |
(?x)\.\.\ (
(?x)
# Check for cases of e.g. .. warning: instead of .. warning::
\.\.\ (
autosummary|contents|currentmodule|deprecated|
function|image|important|include|ipython|literalinclude|
math|module|note|raw|seealso|toctree|versionadded|
Expand All @@ -69,7 +71,9 @@ repos:
language: pygrep
entry: |
(?x)^(
# Check for imports from pandas.core.common instead of `import pandas.core.common as com`
from\ pandas\.core\.common\ import|
# Check for imports from collections.abc instead of `from collections import abc`
from\ pandas\.core\ import\ common|
from\ collections\.abc\ import|
from\ numpy\ import\ nan
Expand All @@ -80,8 +84,10 @@ repos:
language: pygrep
entry: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a followup we might want to update the contributing docs to put a pointer to these types of checks here (e.g. rather than just mentioning code_checks.sh) esp as we are using these a lot more now

(?x)^(
# Check for imports from pandas._testing instead of `import pandas._testing as tm`
from\ pandas\._testing\ import|
from\ pandas\ import\ _testing\ as\ tm|
# No direct imports from conftest
conftest\ import|
import\ conftest
)
Expand Down
0