mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-07 17:00:32 +02:00
lint: Also enable source statements for non-gitian
This commit is contained in:
@ -35,8 +35,9 @@ if ! command -v shellcheck > /dev/null; then
|
|||||||
exit $EXIT_CODE
|
exit $EXIT_CODE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
|
||||||
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
|
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
|
EXIT_CODE=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -46,14 +47,13 @@ if ! command -v yq > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
EXCLUDE_GITIAN=${EXCLUDE}",$(IFS=','; echo "${disabled_gitian[*]}")"
|
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')
|
for descriptor in $(git ls-files -- 'contrib/gitian-descriptors/*.yml')
|
||||||
do
|
do
|
||||||
script=$(basename "$descriptor")
|
script=$(basename "$descriptor")
|
||||||
# Use #!/bin/bash as gitian-builder/bin/gbuild does to complete a script.
|
# Use #!/bin/bash as gitian-builder/bin/gbuild does to complete a script.
|
||||||
echo "#!/bin/bash" > $script
|
echo "#!/bin/bash" > $script
|
||||||
yq -r .script "$descriptor" >> $script
|
yq -r .script "$descriptor" >> $script
|
||||||
if ! $SHELLCHECK_CMD $script; then
|
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE_GITIAN" $script; then
|
||||||
EXIT_CODE=1
|
EXIT_CODE=1
|
||||||
fi
|
fi
|
||||||
rm $script
|
rm $script
|
||||||
|
Reference in New Issue
Block a user