Skip to content

Commit a3f6167

Browse files
committed
test: Make more shell scripts verifiable by the shellcheck tool
1 parent 7f0f853 commit a3f6167

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

contrib/guix/libexec/prelude.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
export LC_ALL=C
33
set -e -o pipefail
44

5-
# shellcheck source=../../shell/realpath.bash
5+
# shellcheck source=contrib/shell/realpath.bash
66
source contrib/shell/realpath.bash
77

8-
# shellcheck source=../../shell/git-utils.bash
8+
# shellcheck source=contrib/shell/git-utils.bash
99
source contrib/shell/git-utils.bash
1010

1111
################

test/lint/lint-shell.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ if ! command -v shellcheck > /dev/null; then
2020
exit $EXIT_CODE
2121
fi
2222

23-
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
23+
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced --source-path=SCRIPTDIR)
2424
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
2525
# Check shellcheck directive used for sourced files
2626
mapfile -t SOURCED_FILES < <(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}')
27+
mapfile -t GUIX_FILES < <(git ls-files contrib/guix contrib/shell | xargs gawk '/^#!\/usr\/bin\/env bash/ {print FILENAME} {nextfile}')
2728
mapfile -t FILES < <(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|minisketch|univalue)/')
28-
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" "${SOURCED_FILES[@]}" "${FILES[@]}"; then
29+
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" "${SOURCED_FILES[@]}" "${GUIX_FILES[@]}" "${FILES[@]}"; then
2930
EXIT_CODE=1
3031
fi
3132

0 commit comments

Comments
 (0)