-
Notifications
You must be signed in to change notification settings - Fork 38.6k
test: Enable SC2046 and SC2086 shellcheck rules #23462
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
3b7f0b6 to
02e9579
Compare
|
Since you are already touching the ci scripts with double quotes |
|
Friendly ping @dongcarl and @practicalswift |
|
Approach ACK |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
02e9579 to
27fbb10
Compare
|
Updated 02e9579 -> 27fbb10 (pr23462.03 -> pr23462.04):
|
|
Tested successfully:
|
Zero-1729
left a comment
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.
tACK 27fbb10
Tested on macOS v12.0.1 (21A559)
Successfully tested the following files locally and can verify the SC2046 & SC2086 warnings fixed:
Note: On macOS, the default
sedtriggers an error when runninggen-manpages.sh. This is resolved by using the GNU versiongnu-sedinstead (i.e. install and prepend its path inPATHto override the defaultsed). Runningsrc/qt/res/animation/makespinner.shalso requiresimagemagick.contrib/macdeploy/detached-sig-apply.shrequires signapple installed.
- contrib/devtools/gen-manpages.sh
- src/qt/res/animation/makespinner.sh
- contrib/macdeploy/detached-sig-apply.sh
PS: the minor notes above are intended only for those who haven't run these files before on macOS.
Wrt general gen-manpages.sh frustrations: please see #22681. The sed parts are likely going to be removed completely before 0.23. |
|
|
||
| if [ "$CI_OS_NAME" == "macos" ]; then | ||
| sudo -H pip3 install --upgrade pip | ||
| # shellcheck disable=SC2086 |
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.
What is the idea of disabling these specific checks in some places? Is the idea that these are temporary and need to be fixed later? (but too much hassle to fix in this PR?)
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.
What is the idea of disabling these specific checks in some places?
$ PIP_PACKAGES="zmq lief"
$ pip3 install --user "$PIP_PACKAGES"
ERROR: Invalid requirement: 'zmq lief'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.
So some code can inherently not be written to conform to SC2086?
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.
Looks like that. And that code requires # shellcheck disable=SC2086.
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 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.
This works:
$ PIP_PACKAGES=(zmq lief)
$ pip3 install --user "${PIP_PACKAGES[@]}"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.
Using arrays sounds like a good idea to me. At least for scripts like this that explicitly need bash.
|
Concept ACK, unintentional globbing and word splitting lead to inscrutable bugs. We should mark with a |
Could we leave introducing arrays for a follow up? |
Fine with me. Merging this soon closes off new such issues being introduced. And it's already the second try. |
27fbb10 to
fe0ff56
Compare
|
Updated 27fbb10 -> fe0ff56 (pr23462.04 -> pr23462.05):
Now this PR introduces
|
|
Code review re-ACK fe0ff56 |
Closes #20879.
Replaces #22695.
Note for reviewers. Some touched shell scripts are not being run in CI, therefore they require more thorough reviewing:
contrib/devtools/gen-manpages.shcontrib/macdeploy/detached-sig-apply.shcontrib/windeploy/detached-sig-create.shsrc/qt/res/animation/makespinner.sh