-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BLD: extract GH Actions check function to avoid duplication in code_checks.sh #37110
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
Conversation
looks fine, cc @MarckK @datapythonista if any comments. @plammens if you can merge master so we can get a green build |
Cherry-picked from 8611fe6
5ec853b
to
d262ff1
Compare
Done; rebased onto latest master. |
I personally find this more complicated than needed. I agree having the if and duplicating the call should be simplified. But I think implementing a function makes things too complex. What I would do is instead of: if [[ "$GITHUB_ACTIONS" == "true" ]]; then
$BASE_DIR/scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate" --format="##[error]{source_path}:{line_number}:{msg}" .
else
$BASE_DIR/scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate" .
fi Simply have: $BASE_DIR/scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate" --format=$FORMAT Then, there are several $FORMAT that will be the same, and there is already an |
Yep this actually makes more sense. I think what happened is that I cherry picked this change, without giving it much thought, from #36386, where I think a function does make sense since there's already some On the other hand, if we consider the possibility that in the future other commands might depend on whether they're running on GH-actions (and in a less trivial way than just changing the format), it might be worthwhile to add the function. |
@jreback @datapythonista Any more thoughts on this? Should I do what @datapythonista suggested (just extracting a |
most of this is done in precommit anyhow is this PR still needed? |
Just checked the code on master and it looks like this is no longer needed. Closing this. |
This PR extracts a function
if_gh_actions
inci/code_checks.sh
to avoid command/arguments duplication. Originally part of #36386 (cherry-picked from 8611fe6); extracted to make the changes more modular (see the cross-linked comment).black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff