Skip to content

Commit a4f6ffa

Browse files
committed
lint: Also enable source statements for non-gitian
1 parent d256f91 commit a4f6ffa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/lint/lint-shell.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ if ! command -v shellcheck > /dev/null; then
3535
exit $EXIT_CODE
3636
fi
3737

38+
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
3839
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
39-
if ! shellcheck "$EXCLUDE" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then
40+
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then
4041
EXIT_CODE=1
4142
fi
4243

@@ -46,14 +47,13 @@ if ! command -v yq > /dev/null; then
4647
fi
4748

4849
EXCLUDE_GITIAN=${EXCLUDE}",$(IFS=','; echo "${disabled_gitian[*]}")"
49-
SHELLCHECK_CMD="shellcheck --external-sources --check-sourced $EXCLUDE_GITIAN"
5050
for descriptor in $(git ls-files -- 'contrib/gitian-descriptors/*.yml')
5151
do
5252
script=$(basename "$descriptor")
5353
# Use #!/bin/bash as gitian-builder/bin/gbuild does to complete a script.
5454
echo "#!/bin/bash" > $script
5555
yq -r .script "$descriptor" >> $script
56-
if ! $SHELLCHECK_CMD $script; then
56+
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE_GITIAN" $script; then
5757
EXIT_CODE=1
5858
fi
5959
rm $script

0 commit comments

Comments
 (0)