-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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: Unify code_checks whitespace checking #30755
CI: Unify code_checks whitespace checking #30755
Conversation
For #30737. Is it possible to do this via regex? similar to the current code check for context manager: |
Yes, for simple cases like with pytest.raises(ValueError) or (For false positives) with pytest.raises(ValueError, match="foo") But I want a "global" test case. So even if there's an edge case, for example: with pytest.raises(
ValueError,
# Some comment
) or (For the case of false positives) with pytest.raises(
ValueError,
# Some comment
match="foo"
) Regex is very fast, and for a reason, regex is not looking in the So I wrote a global test case that looks in the When I detect the occurrence of My point is, regex is nice for "simple things" but when you have so many edge cases, I'd like to stick to checking it via the P.S |
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.
Any chance you can make the edits in place first without changing files? Typically easier to review that way
If you are moving and modifying things easier to do separately
Agree with Will, do you mind leaving the name unchanged in this PR, even if it's not accurate, so we can review the new changes only. Then it's easy to just rename in a follow up, and get that merged quickly. Just one early comment, I'm -1 on creating abbreviations like |
Not sure what you mean by that @WillAyd , can you please be more specific? |
Check my last comment |
So just change the function names, back to the very original? |
No, sorry. The file name, so the diff will show what you changed in that file. |
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.
Nice stuff. Some comments, but the general idea looks good.
@jbrockmendel I can see (And do you know by any chance someone from And about the regex, I completely understand why this PR seems like overkill when a simple regex can do the trick, for the most part. but isn't that the fact why we are using tools like |
I agree having these checks in the pandas code base is not ideal. But I'd move forward with this PR, get the validation working better (we already have the validation, this is just improving and refactoring what we've got). And later on, we can consider moving this out of pandas, as we did with the docstrings. @MomIsBestFriend can you merge master and see if the CI is green please? |
I'm completely happy deferring to @datapythonista on this. Thanks @MomIsBestFriend for taking this on. |
Restarting azure |
ping @datapythonista |
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.
Thanks @MomIsBestFriend
@WillAyd I think your comments were addressed, can you have a look and merge if you're happy.
I will relook in a few days |
@MomIsBestFriend sorry we've been slow with this. Do you mind merging master once more please? I'll merge this once CI is green. |
@datapythonista I just merged master, I'll wait for another commit to be merged, before I can merge master again. |
Oh, sorry, I thought the CI was stalled, never mind then. Ping me once it's green if I don't merge it before. Thanks! |
ping @datapythonista :) |
Thanks @MomIsBestFriend, great job. Can you follow up renaming the file please? |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Unify test cases of #30467 #30708 #30737