-
Notifications
You must be signed in to change notification settings - Fork 502
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
Fixing shellcheck warnings in prin #763
Conversation
@pswica: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justaugustus, pswica The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
CP_COMMITS=($(git log --grep "cherry-pick-of-.*#$PR-" \ | ||
--all --pretty=format:"%h")) | ||
mapfile -i CP_COMMITS < <(git log --grep "cherry-pick-of-.*#$PR-" \ | ||
--all --pretty=format:"%h") |
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.
@pswica, here I met this error when used mapfile -i
:
/Users/llhu/Desktop/test/release/release/prin: line 154: mapfile: -i: invalid option mapfile: usage: mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
Is there some errors in my local side. Thanks
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 so much for catching. No this was my bad. I messed up by putting -i
instead of -t
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.
PR here
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.
arrays are tricky
@@ -70,7 +72,7 @@ show_tags () { | |||
local pr=$1 | |||
local initial_commit=$2 | |||
shift 2 | |||
local cp_commits=($*) | |||
local cp_commits=("$*") |
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.
There is a good chance this should be "$@"
instead, ref: https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
|
||
security_layer::hosted_map | ||
|
||
show_tags "$PR" $INITIAL_COMMIT ${CP_COMMITS[*]} | ||
show_tags "$PR" "${INITIAL_COMMIT[0]}" "${CP_COMMITS[*]}" |
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.
There is a good chance this should be "${CP_COMMITS[@]}"
instead, ref: https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
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 a lot for reading these. I'm sure there is a lot of hidden bugs/weirdness from my shellcheck changes. I will create an issue and link this, and other things found, to it
Please see: #742 and #726 for more details and context.
Let me know anything else to improve on :)