-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Add shell script linting: Check for shellcheck warnings in shell scripts #12871
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
f10e3c4
to
d4d4ac0
Compare
I'd prefer if we minimized the number of shell scripts instead, since the number of people that can (and are willing to) review them is almost zero. Though, at least enforcing some sensible syntax can't hurt. |
@MarcoFalke I agree that the long-term plan should be to minimize the number of shell scripts. In the short-term I think it is a good idea to automate the mechanical part of the review process. That will allow for us scarce shell script reviewers to focus on the important stuff rather on trivial things that can be automated away using Personally I run |
d4d4ac0
to
6a4a156
Compare
utACK 6a4a156 |
utACK 6a4a156d269da0b286957a5b4c480e7f7429879b |
I'm not up to date on shell linting tools. Does this detect dangerous constructions, or is it just about style?
Indeed. In general I'd prefer Python scripts, although shell scripts are fast to hack together they're easier to review, and maintain on the long run. Though for linting other shell scripts a shell script makes sense I guess. |
utACK 6a4a156d269da0b286957a5b4c480e7f7429879b |
@laanwj The focus on From the
The gallery of bad shell scripts gives a couple of examples of issues that I've used |
SGTM, thanks for elaborating. |
6a4a156
to
1499fdc
Compare
Looks like this fails at the moment, at least when I run it locally;
|
Pushed an updated version which excludes |
@laanwj Please retry with the version I pushed the second before your comment :-) |
Right, passes now re-utACK 1499fdc |
Going to merge this under the provision that we can refine or disable it if it causes problems. |
… in shell scripts 1499fdc Add shell script linting: Check for shellcheck warnings in shell scripts (practicalswift) Pull request description: Add shell script linting: Check for `shellcheck` warnings in shell scripts. Tree-SHA512: c7f3f5ed9933415666d2a02f5658cdc62b959ce8112f46b6327ff5f77bb5a66710704c0cde5fd8e719d1fa1fc4f0375a0c115faced166b78e81b75dfb862f08e
@MarcoFalke Thanks for merging! Ping me if any troubles or false positives are encountered with this linter and I'll fix! |
…arnings in shell scripts 1499fdc Add shell script linting: Check for shellcheck warnings in shell scripts (practicalswift) Pull request description: Add shell script linting: Check for `shellcheck` warnings in shell scripts. Tree-SHA512: c7f3f5ed9933415666d2a02f5658cdc62b959ce8112f46b6327ff5f77bb5a66710704c0cde5fd8e719d1fa1fc4f0375a0c115faced166b78e81b75dfb862f08e Signed-off-by: pasta <pasta@dashboost.org>
…arnings in shell scripts 1499fdc Add shell script linting: Check for shellcheck warnings in shell scripts (practicalswift) Pull request description: Add shell script linting: Check for `shellcheck` warnings in shell scripts. Tree-SHA512: c7f3f5ed9933415666d2a02f5658cdc62b959ce8112f46b6327ff5f77bb5a66710704c0cde5fd8e719d1fa1fc4f0375a0c115faced166b78e81b75dfb862f08e Signed-off-by: pasta <pasta@dashboost.org>
…arnings in shell scripts 1499fdc Add shell script linting: Check for shellcheck warnings in shell scripts (practicalswift) Pull request description: Add shell script linting: Check for `shellcheck` warnings in shell scripts. Tree-SHA512: c7f3f5ed9933415666d2a02f5658cdc62b959ce8112f46b6327ff5f77bb5a66710704c0cde5fd8e719d1fa1fc4f0375a0c115faced166b78e81b75dfb862f08e Signed-off-by: pasta <pasta@dashboost.org>
Backport useful lints from upstream Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6892 - bitcoin/bitcoin#11151 - bitcoin/bitcoin#11300 - bitcoin/bitcoin@96d91b7 - bitcoin/bitcoin#12097 - bitcoin/bitcoin#12098 - bitcoin/bitcoin#12442 - bitcoin/bitcoin#12572 - bitcoin/bitcoin#12757 - bitcoin/bitcoin#11878 - bitcoin/bitcoin#12933 - bitcoin/bitcoin#12871 - bitcoin/bitcoin#12972 - bitcoin/bitcoin#13281 - bitcoin/bitcoin#13385 - bitcoin/bitcoin#13041 - bitcoin/bitcoin#13454 - bitcoin/bitcoin#13448 - bitcoin/bitcoin#13510 - bitcoin/bitcoin#13851 - bitcoin/bitcoin#13863 - bitcoin/bitcoin#14115 - bitcoin/bitcoin#14831 - bitcoin/bitcoin#15164 - bitcoin/bitcoin#15170 - bitcoin/bitcoin#15166 - bitcoin/bitcoin#16036 - bitcoin/bitcoin#16768 Several of the lints fail for our current codebase; these will be addressed in a subsequent PR.
Backport useful lints from upstream Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6892 - bitcoin/bitcoin#11151 - bitcoin/bitcoin#11300 - bitcoin/bitcoin@96d91b7 - bitcoin/bitcoin#12097 - bitcoin/bitcoin#12098 - bitcoin/bitcoin#12442 - bitcoin/bitcoin#12572 - bitcoin/bitcoin#12757 - bitcoin/bitcoin#11878 - bitcoin/bitcoin#12933 - bitcoin/bitcoin#12871 - bitcoin/bitcoin#12972 - bitcoin/bitcoin#13281 - bitcoin/bitcoin#13385 - bitcoin/bitcoin#13041 - bitcoin/bitcoin#13454 - bitcoin/bitcoin#13448 - bitcoin/bitcoin#13510 - bitcoin/bitcoin#13851 - bitcoin/bitcoin#13863 - bitcoin/bitcoin#14115 - bitcoin/bitcoin#14831 - bitcoin/bitcoin#15164 - bitcoin/bitcoin#15170 - bitcoin/bitcoin#15166 - bitcoin/bitcoin#16036 - bitcoin/bitcoin#16768 - bitcoin/bitcoin#13494 Several of the lints fail for our current codebase; these will be addressed in a subsequent PR.
…arnings in shell scripts 1499fdc Add shell script linting: Check for shellcheck warnings in shell scripts (practicalswift) Pull request description: Add shell script linting: Check for `shellcheck` warnings in shell scripts. Tree-SHA512: c7f3f5ed9933415666d2a02f5658cdc62b959ce8112f46b6327ff5f77bb5a66710704c0cde5fd8e719d1fa1fc4f0375a0c115faced166b78e81b75dfb862f08e Signed-off-by: pasta <pasta@dashboost.org>
Add shell script linting: Check for
shellcheck
warnings in shell scripts.