Skip to content

Conversation

@Zero-1729
Copy link
Contributor

@Zero-1729 Zero-1729 commented Aug 13, 2021

Update: Closing this in favour of Hebasto's replacement PR.

As per #20879, this PR enables the shellcheck rules SC2046 and SC2086 respectfully in the lint-shell.sh script to, amongst other things, prevent unintentional word-splitting, and make the shell scripts "conformant and therefore more robust", as dongcarl stated here.

  • Enable SC2046 & SC2086 rules (7f1fc5e)
  • Fix all SC2046 warnings
  • Fix all SC2086 warnings

Closes #20879

@fanquake
Copy link
Member

If you want to enable these you actually need to fix all of the warnings / issues in the code. You will see them all in the lint CI output. Or you can run the linter locally.

@Zero-1729
Copy link
Contributor Author

Ran the linter locally, and can see the following count of cases:

$ test/lint/lint-shell.sh | grep SC2046 | wc -l
18

$ test/lint/lint-shell.sh | grep SC2086 | wc -l
178

Thanks @fanquake for the clarification, I'll fix all cases and push.

@Zero-1729 Zero-1729 marked this pull request as draft August 13, 2021 08:50
@jonatack
Copy link
Member

Concept ACK

@laanwj
Copy link
Member

laanwj commented Aug 18, 2021

Concept ACK, these seem quite serious.

@maflcko
Copy link
Member

maflcko commented Aug 18, 2021

This might accidentally fix #12528

@hebasto
Copy link
Member

hebasto commented Nov 7, 2021

This might accidentally fix #12528

No, it does not fix #12528. Tested on macOS Big Sur 11.6.1 (20G224) + #23462.

@Zero-1729
Copy link
Contributor Author

Sorry, lost track of this PR.

@hebasto thanks for opening a replacement! Closing this now in favour of yours.

@Zero-1729 Zero-1729 closed this Nov 7, 2021
laanwj added a commit that referenced this pull request Nov 15, 2021
fe0ff56 test: Enable SC2046 shellcheck rule (Hennadii Stepanov)
9a1ad7b test: Enable SC2086 shellcheck rule (Hennadii Stepanov)

Pull request description:

  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.sh`
  - `contrib/macdeploy/detached-sig-apply.sh`
  - `contrib/windeploy/detached-sig-create.sh`
  - `src/qt/res/animation/makespinner.sh`

ACKs for top commit:
  laanwj:
    Code review re-ACK fe0ff56

Tree-SHA512: 73619b9a7bcb6cf0dfc4189a753ef550d40c82a3432bb9d8d8a994310d42594576038daac7e0c2fc004d716976bb1413b9a77848ecf088b25b69ed0773b77e8e
@bitcoin bitcoin locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lint-shell: Enable SC2046 and SC2086, prevent unintentional word-splitting

6 participants