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
fix shellcheck in hack/... and pkg/... and staging/... #74205
fix shellcheck in hack/... and pkg/... and staging/... #74205
Conversation
933a839
to
378251f
Compare
/test pull-kubernetes-e2e-gce |
…/hack/... update pull request update pull request update pull request update pull request update pull request update pull request update pull request update pull request
/assign @BenTheElder |
${CODEGEN_PKG}/generate-groups.sh client \ | ||
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ | ||
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt | ||
"${CODEGEN_PKG}"/generate-groups.sh client \ |
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.
please quote the whole string for these
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.
Thank you for your reminding. I have modified it. Thank you
378251f
to
fd86907
Compare
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ | ||
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt |
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.
and here please :-)
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.
Has been completed.
fd86907
to
957192b
Compare
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.
/lgtm
/approve
/test pull-kubernetes-e2e-gce-100-performance |
--output-base "$(dirname ${BASH_SOURCE})/../../.." \ | ||
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt | ||
${CODEGEN_PKG}/generate-groups.sh client \ | ||
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ |
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 would pull this out into its own OUTPUT_BASE var above, so you don't have the weird nested quotes thing going on here, ie:
OUTPUT_BASE=$(dirname "${BASH_SOURCE[0]}")/../../..
#...
--output-base "${OUTPUT_BASE}"
You might also consider using SCRIPT_ROOT
instead of redoing the BASH_SOURCE
thing.
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.
Brother, this modification will cause additional problems.
It will look like this:
In ./staging/src/k8s.io/metrics/hack/update-codegen.sh line 35:
--output-base "${OUTPUT_BASE}"
^-----------^ SC2215: This flag is used as a command name. Bad line break or missing [ .. ]?
In ./staging/src/k8s.io/metrics/hack/update-codegen.sh line 36:
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
^--------------^ SC2215: This flag is used as a command name. Bad line break or missing [ .. ]?
did I make a mistake? Do you have a detailed reply? thank you
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.
You are likely missing \
at the end of the line above it and on the end of the line containing --output-base "${OUTPUT_BASE}"
It should look similar to this:
"${CODEGEN_PKG}/generate-internal-groups.sh" deepcopy,conversion \
k8s.io/metrics/pkg/client k8s.io/metrics/pkg/apis k8s.io/metrics/pkg/apis \
"metrics:v1alpha1,v1beta1 custom_metrics:v1beta1 external_metrics:v1beta1" \
--output-base "${OUTPUT_BASE}" \
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
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.
--output-base "${OUTPUT_BASE}" \
Appear above problem.
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 agree with @mrbobbytables the error really reads like a missing trailing \
, shellcheck was happy with my suggested changes locally
Since I can't see the source you're running this against, my advice would be to look above your output-base
and go-header-file
lines
New changes are detected. LGTM label has been removed. |
8cbebd4
to
957192b
Compare
957192b
to
b1fac2a
Compare
/retest |
needs rebase /priority important-longterm |
db8ff08
to
bc6bff4
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BenTheElder, xichengliudui If they are not already assigned, you can assign the PR to them by writing 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 |
/retest |
9be1273
to
ca2bc4b
Compare
@xichengliudui: The following tests failed for commit ca2bc4b, 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. |
What type of PR is this?
fix shellcheck in hack/... and pkg/... and staging/...
/kind cleanup
What this PR does / why we need it:
fix shellcheck in hack/... and pkg/... and staging/...
Which issue(s) this PR fixes:
Ref #72956
Special notes for your reviewer:
Does this PR introduce a user-facing change?: