-
Notifications
You must be signed in to change notification settings - Fork 37.7k
scripts and tools: Update ShellCheck linter #16327
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
|
cef55d3
to
077b62e
Compare
Fixed. OP updated with a note for reviewers. |
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. |
ACK 077b62e test/lint/lint-shell.sh passes on macOS 10.14.5 |
I was wrong: the 05fa54d commit is misleading. There is nothing macOS specific in SC1087, SC2206, SC2207, SC2230 and SC2236 warnings.
But we use version The misleading commit will be removed today. |
Strong concept ACK: As an active reviewer of all shell scripts added to the project I applaud this change: it will make sure more of the bugs introduced due to "language level misunderstandings" are fixed before human review takes place. That is clearly a good thing. Case in point: This change fixes such a bug/misunderstanding in |
077b62e
to
e8683bf
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.
utACK e8683bf
Strongly in favor of stricter linting with shellcheck for shell scripts. They can be very hard to debug or fail silently if they're not.
When @dongcarl's comments are addressed I think these changes should be ready to go. One last thing: These tests remain disabled after this PR:
I think it makes sense to keep these disabled with one exception: @hebasto Would it be feasible to also enable Given the problems with the legacy form and the fact that all of these problems can be avoided by simply switching to Quoting Use
|
e8683bf
to
4dd3018
Compare
Done. |
4dd3018
to
9dd9e2c
Compare
Done.
What commit message would be appropriate after squashing of all commits? |
@hebasto Title "Enable shellcheck rules" and description could be the squashed messages? :-) |
9dd9e2c
to
cb2f23d
Compare
Squashed. |
Very nice! utACK cb2f23d |
Enabled ShellCheck rules: SC1087 SC2001 SC2004 SC2005 SC2006 SC2016 SC2028 SC2048 SC2066 (note that IFS already contains only a line feed) SC2116 SC2166 SC2181 SC2206 SC2207 SC2230 SC2236
cb2f23d
to
1ac454a
Compare
@practicalswift the rules in commit message are ordered now. |
utACK 1ac454a |
utACK 1ac454a |
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.
ACK 1ac454a
Tested ./autogen.sh
, contrib/install_db4.sh
, contrib/devtools/gen-manpages.sh
, contrib/verify-commits/gpg.sh
, contrib/verifybinaries/verify.sh bitcoin-core-0.18.0
all still work. test/lint/lint-all.sh
seems to pass.
1ac454a Enable ShellCheck rules (Hennadii Stepanov) Pull request description: Enable some simple ShellCheck rules. Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu. For local tests the latest `shellcheck` version 0.6.0 should be used (see #15166). ACKs for top commit: practicalswift: utACK 1ac454a dongcarl: utACK 1ac454a fanquake: ACK 1ac454a Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
Verifier for scriptable changes Includes changes from the following upstream PRs: - bitcoin/bitcoin#10189 - Excluding the `CNode` scripted changes. - bitcoin/bitcoin#10480 - bitcoin/bitcoin#11390 - bitcoin/bitcoin#13281 - Only the lint scripts we already have. - bitcoin/bitcoin#13454 - Only changes to scripts we already have. - bitcoin/bitcoin#14864 - bitcoin/bitcoin#16327 - Includes some portability fixes to other shell scripts. - bitcoin/bitcoin#20069
1ac454a Enable ShellCheck rules (Hennadii Stepanov) Pull request description: Enable some simple ShellCheck rules. Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu. For local tests the latest `shellcheck` version 0.6.0 should be used (see bitcoin#15166). ACKs for top commit: practicalswift: utACK 1ac454a dongcarl: utACK 1ac454a fanquake: ACK 1ac454a Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
1ac454a Enable ShellCheck rules (Hennadii Stepanov) Pull request description: Enable some simple ShellCheck rules. Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu. For local tests the latest `shellcheck` version 0.6.0 should be used (see bitcoin#15166). ACKs for top commit: practicalswift: utACK 1ac454a dongcarl: utACK 1ac454a fanquake: ACK 1ac454a Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
1ac454a Enable ShellCheck rules (Hennadii Stepanov) Pull request description: Enable some simple ShellCheck rules. Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu. For local tests the latest `shellcheck` version 0.6.0 should be used (see bitcoin#15166). ACKs for top commit: practicalswift: utACK 1ac454a dongcarl: utACK 1ac454a fanquake: ACK 1ac454a Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
Enable some simple ShellCheck rules.
Note for reviewers:
bash
andshellcheck
on macOS are different from ones on Ubuntu.For local tests the latest
shellcheck
version 0.6.0 should be used (see #15166).