-
Notifications
You must be signed in to change notification settings - Fork 38.6k
test: Make more shell scripts verifiable by the shellcheck tool
#23506
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
|
cc @dongcarl |
|
Concept ACK, I'd be happier adding extensions to the scripts or renaming the extension when it's a rare one (e.g. '.bash' => change to '.sh'). The interpreter is meant to be defined in the first line of the script, |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
c6f7b89 to
93a7c37
Compare
|
Rebased c6f7b89 -> 93a7c37 (pr23506.01 -> pr23506.02) due to the conflict with #23462. |
|
Concept ACK! I'm guessing |
It seems |
|
Concept ACK
What warnings are being fixed here? Looks like it's just updating the |
For instance: $ test/lint/lint-shell.sh
In contrib/guix/guix-attest line 10:
source "$(dirname "${BASH_SOURCE[0]}")/libexec/prelude.bash"
^-- SC1091: Not following: libexec/prelude.bash: openBinaryFile: does not exist (No such file or directory)
For more information:
https://www.shellcheck.net/wiki/SC1091 -- Not following: libexec/prelude.ba...I mean, "just updating the |
fanquake
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.
|
@hebasto Did you look into if it'd be possible to do relative to script path? I'm seeing on the man page that you can use a |
93a7c37 to
a3f6167
Compare
|
Updated 93a7c37 -> a3f6167 (pr23506.02 -> pr23506.03, diff). Addressed @dongcarl's #23506 (comment):
|
./test/lint/lint-all.sh
....
In contrib/guix/guix-clean line 37:
path_residue="${2##${1}}"
^--^ SC2295 (info): Expansions inside ${..} need to be quoted separately, otherwise they match as patterns.
Did you mean:
path_residue="${2##"${1}"}"
For more information:
https://www.shellcheck.net/wiki/SC2295 -- Expansions inside ${..} need to b...
^---- failure generated from ./test/lint/lint-shell.sh |
Looks like you're using shellcheck v0.8.0, while for now Line 20 in ffdf8ee
|
|
Code Review ACK a3f6167, this is a good robustness improvement for our shell scripts. |
|
crACK a3f6167 Introduces shellcheck coverage, passes CI - sounds good to me. |
I don't understand this logic. The whole point of this PR was to start checking these scripts, and fix any issues. An issue was pointed out, and then just ignored, because it was found with a newer version of a tool. If someone found an issue in our C++ code, with a newer version of a sanitizer, we'd hardly ignore that just because we weren't using that exact version in our CI. |
5202bd1 test: Bump shellcheck version to 0.8.0 (Hennadii Stepanov) Pull request description: Among [added](https://github.com/koalaman/shellcheck/blob/master/CHANGELOG.md#v080---2021-11-06) rules, SC2295 could be [useful](bitcoin/bitcoin#23506 (comment)) for us. ACKs for top commit: dongcarl: Code Review ACK 5202bd1 fanquake: ACK 5202bd1 - would have rather this just been a part of #23506 to avoid another PR and pointless rebasing. Tree-SHA512: fd7ff801c71af03c5a5b2823b7daba25a430b3ead5e5e50a3663961ee2223e55d322aec91d79999814cd35bd7ed6e9415a0b797718ceb8c0b1dbdbb40c336b82
5202bd1 test: Bump shellcheck version to 0.8.0 (Hennadii Stepanov) Pull request description: Among [added](https://github.com/koalaman/shellcheck/blob/master/CHANGELOG.md#v080---2021-11-06) rules, SC2295 could be [useful](bitcoin#23506 (comment)) for us. ACKs for top commit: dongcarl: Code Review ACK 5202bd1 fanquake: ACK 5202bd1 - would have rather this just been a part of bitcoin#23506 to avoid another PR and pointless rebasing. Tree-SHA512: fd7ff801c71af03c5a5b2823b7daba25a430b3ead5e5e50a3663961ee2223e55d322aec91d79999814cd35bd7ed6e9415a0b797718ceb8c0b1dbdbb40c336b82
My assumption was that CI and local environments should be consistent for lint tasks. Otherwise, the local lint task could just fail with default settings. If this assumption is wrong maybe document the correct one?
No, it was not ignored at all. To address the pointed issue, the #23635 was opened. Sorry about that. I never ignored your comments before. |
|
I think it was fine to split up the two pulls. And after all it is just the linters, so it shouldn't matter too much if it was split up or not. |
… by the `shellcheck` tool 56a3907 test: Make more shell scripts verifiable by the `shellcheck` tool (Hennadii Stepanov) Pull request description: Some shell scripts from `contrib/guix` and `contrib/shell` are not verifiable by the `shellcheck` tool for the following reasons: - they have no extension (see bitcoin/bitcoin@d8d1eb0 from bitcoin/bitcoin#21375) - they have the `.bash` extension while `.sh` is expected This PR adds these scripts to the input for the `shellcheck` tool, and it fixes discovered `shellcheck` warnings. ACKs for top commit: dongcarl: Code Review ACK 56a3907, this is a good robustness improvement for our shell scripts. jamesob: crACK bitcoin/bitcoin@56a3907 Tree-SHA512: 6703f5369d9c04c1a174491f381afa5ec2cc4d37321c1b93615abcdde4dfd3caae82868b699c25b72132d8c8c6f2e9cf24d38eb180ed4d0f0584d8c282e58935
76b8372 test: Bump shellcheck version to 0.8.0 (Hennadii Stepanov) Pull request description: Among [added](https://github.com/koalaman/shellcheck/blob/master/CHANGELOG.md#v080---2021-11-06) rules, SC2295 could be [useful](bitcoin/bitcoin#23506 (comment)) for us. ACKs for top commit: dongcarl: Code Review ACK 76b8372 fanquake: ACK 76b8372 - would have rather this just been a part of #23506 to avoid another PR and pointless rebasing. Tree-SHA512: fd7ff801c71af03c5a5b2823b7daba25a430b3ead5e5e50a3663961ee2223e55d322aec91d79999814cd35bd7ed6e9415a0b797718ceb8c0b1dbdbb40c336b82
…`shellcheck` tool a3f6167 test: Make more shell scripts verifiable by the `shellcheck` tool (Hennadii Stepanov) Pull request description: Some shell scripts from `contrib/guix` and `contrib/shell` are not verifiable by the `shellcheck` tool for the following reasons: - they have no extension (see bitcoin@4eccf06 from bitcoin#21375) - they have the `.bash` extension while `.sh` is expected This PR adds these scripts to the input for the `shellcheck` tool, and it fixes discovered `shellcheck` warnings. ACKs for top commit: dongcarl: Code Review ACK a3f6167, this is a good robustness improvement for our shell scripts. jamesob: crACK bitcoin@a3f6167 Tree-SHA512: 6703f5369d9c04c1a174491f381afa5ec2cc4d37321c1b93615abcdde4dfd3caae82868b699c25b72132d8c8c6f2e9cf24d38eb180ed4d0f0584d8c282e58935
Some shell scripts from
contrib/guixandcontrib/shellare not verifiable by theshellchecktool for the following reasons:.bashextension while.shis expectedThis PR adds these scripts to the input for the
shellchecktool, and it fixes discoveredshellcheckwarnings.