-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
CI move non-standard-import checks over to pre-commit #37240
Conversation
.pre-commit-config.yaml
Outdated
language: pygrep | ||
entry: >- | ||
(from pandas.core.common import|from pandas.core import common | ||
|from collections.abc import|from numpy import nan) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: id put each of these on separate lines, same on L76-77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd got the multiline string wrong. >-
will put a space between each line. Solution is to use "
and to escape the backslashes (as in the latest commit)
This looks fine. Has there been a discussion somewhere where theres consensus to move as much as possible/convenient to the pre-commit? |
There hasn't, there was just this discussion as a precedent #36386 , and Will's comment
There was one PR (#37136) where using pygrep instead of invgrep revealed a case which wasn't being found. I'd welcome a discussion about whether this is welcome in general of course - as per this PR's description, I think it would be beneficial |
can you merge master and pin gon green. |
c801ff4
to
0d1f75d
Compare
0d1f75d
to
7ba9c50
Compare
ping |
- id: non-standard-imports-in-tests | ||
name: Check for non-standard imports in test suite | ||
language: pygrep | ||
entry: | |
There was a problem hiding this comment.
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
thanks @MarcoGorelli |
Like this they're cross-platform, provide faster feedback to devs, and can use pre-commit
pygrep
instead of the custominvgrep