aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-04-28 12:51:15 -0400
committerCarl Dong <contact@carldong.me>2020-05-01 12:31:07 -0400
commita4f6ffa71e335d4b2a6bf525b7f416968f9cd9f7 (patch)
tree12d3916faf0874e6fdc66aa055f5c2b248fffea6 /test
parentd256f91cb1b0d6ff5170106b99b0266cbe51f5a2 (diff)
lint: Also enable source statements for non-gitian
Diffstat (limited to 'test')
-rwxr-xr-xtest/lint/lint-shell.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lint/lint-shell.sh b/test/lint/lint-shell.sh
index 2bb76ec286..563e076b35 100755
--- a/test/lint/lint-shell.sh
+++ b/test/lint/lint-shell.sh
@@ -35,8 +35,9 @@ if ! command -v shellcheck > /dev/null; then
exit $EXIT_CODE
fi
+SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
-if ! shellcheck "$EXCLUDE" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then
+if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then
EXIT_CODE=1
fi
@@ -46,14 +47,13 @@ if ! command -v yq > /dev/null; then
fi
EXCLUDE_GITIAN=${EXCLUDE}",$(IFS=','; echo "${disabled_gitian[*]}")"
-SHELLCHECK_CMD="shellcheck --external-sources --check-sourced $EXCLUDE_GITIAN"
for descriptor in $(git ls-files -- 'contrib/gitian-descriptors/*.yml')
do
script=$(basename "$descriptor")
# Use #!/bin/bash as gitian-builder/bin/gbuild does to complete a script.
echo "#!/bin/bash" > $script
yq -r .script "$descriptor" >> $script
- if ! $SHELLCHECK_CMD $script; then
+ if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE_GITIAN" $script; then
EXIT_CODE=1
fi
rm $script