diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-11-07 14:13:39 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-11-13 16:54:56 +0200 |
commit | 9a1ad7bc0dd8a0769738ca4dffbeb8d55438b0dc (patch) | |
tree | eb2ec6cb2b8dd61d246e0e077b875afe445044d0 /test/lint/lint-shell.sh | |
parent | 5cc083cd46ad71510f56af957e2e8733c388c6f1 (diff) | |
download | bitcoin-9a1ad7bc0dd8a0769738ca4dffbeb8d55438b0dc.tar.xz |
test: Enable SC2086 shellcheck rule
Diffstat (limited to 'test/lint/lint-shell.sh')
-rwxr-xr-x | test/lint/lint-shell.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lint/lint-shell.sh b/test/lint/lint-shell.sh index 0e18c73013..1a12df6591 100755 --- a/test/lint/lint-shell.sh +++ b/test/lint/lint-shell.sh @@ -11,7 +11,6 @@ export LC_ALL=C # Disabled warnings: disabled=( SC2046 # Quote this to prevent word splitting. - SC2086 # Double quote to prevent globbing and word splitting. SC2162 # read without -r will mangle backslashes. ) @@ -24,8 +23,9 @@ fi SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced) EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")" -SOURCED_FILES=$(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}') # Check shellcheck directive used for sourced files -if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $SOURCED_FILES $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|minisketch|univalue)/'); then +# Check shellcheck directive used for sourced files +mapfile -t SOURCED_FILES < <(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}') +if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" "${SOURCED_FILES[@]}" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|minisketch|univalue)/'); then EXIT_CODE=1 fi |