mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
merge bitcoin#23506: Make more shell scripts verifiable by the shellcheck
tool
This commit is contained in:
parent
694c1a4582
commit
973ca7b46f
@ -2,10 +2,10 @@
|
|||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
set -e -o pipefail
|
set -e -o pipefail
|
||||||
|
|
||||||
# shellcheck source=../../shell/realpath.bash
|
# shellcheck source=contrib/shell/realpath.bash
|
||||||
source contrib/shell/realpath.bash
|
source contrib/shell/realpath.bash
|
||||||
|
|
||||||
# shellcheck source=../../shell/git-utils.bash
|
# shellcheck source=contrib/shell/git-utils.bash
|
||||||
source contrib/shell/git-utils.bash
|
source contrib/shell/git-utils.bash
|
||||||
|
|
||||||
################
|
################
|
||||||
|
@ -27,12 +27,13 @@ if ! command -v gawk > /dev/null; then
|
|||||||
exit $EXIT_CODE
|
exit $EXIT_CODE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
|
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced --source-path=SCRIPTDIR)
|
||||||
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
|
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
|
||||||
# Check shellcheck directive used for sourced files
|
# Check shellcheck directive used for sourced files
|
||||||
mapfile -t SOURCED_FILES < <(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}')
|
mapfile -t SOURCED_FILES < <(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}')
|
||||||
|
mapfile -t GUIX_FILES < <(git ls-files contrib/guix contrib/shell | xargs gawk '/^#!\/usr\/bin\/env bash/ {print FILENAME} {nextfile}')
|
||||||
mapfile -t FILES < <(git ls-files -- '*.sh' | grep -vE 'src/(dashbls|immer|leveldb|secp256k1|minisketch|univalue)/')
|
mapfile -t FILES < <(git ls-files -- '*.sh' | grep -vE 'src/(dashbls|immer|leveldb|secp256k1|minisketch|univalue)/')
|
||||||
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" "${SOURCED_FILES[@]}" "${FILES[@]}"; then
|
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" "${SOURCED_FILES[@]}" "${GUIX_FILES[@]}" "${FILES[@]}"; then
|
||||||
EXIT_CODE=1
|
EXIT_CODE=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user