Skip to content

Commit c6f7b89

Browse files
committed
test: Make more shell scripts verifiable by the shellcheck tool
1 parent 5cc083c commit c6f7b89

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

contrib/guix/guix-attest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e -o pipefail
66
# 1. Checks if we're at the top directory of the Bitcoin Core repository
77
# 2. Defines a few common functions and variables
88
#
9-
# shellcheck source=libexec/prelude.bash
9+
# shellcheck source=contrib/guix/libexec/prelude.bash
1010
source "$(dirname "${BASH_SOURCE[0]}")/libexec/prelude.bash"
1111

1212

contrib/guix/guix-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e -o pipefail
66
# 1. Checks if we're at the top directory of the Bitcoin Core repository
77
# 2. Defines a few common functions and variables
88
#
9-
# shellcheck source=libexec/prelude.bash
9+
# shellcheck source=contrib/guix/libexec/prelude.bash
1010
source "$(dirname "${BASH_SOURCE[0]}")/libexec/prelude.bash"
1111

1212

contrib/guix/guix-clean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e -o pipefail
66
# 1. Checks if we're at the top directory of the Bitcoin Core repository
77
# 2. Defines a few common functions and variables
88
#
9-
# shellcheck source=libexec/prelude.bash
9+
# shellcheck source=contrib/guix/libexec/prelude.bash
1010
source "$(dirname "${BASH_SOURCE[0]}")/libexec/prelude.bash"
1111

1212

contrib/guix/guix-codesign

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e -o pipefail
66
# 1. Checks if we're at the top directory of the Bitcoin Core repository
77
# 2. Defines a few common functions and variables
88
#
9-
# shellcheck source=libexec/prelude.bash
9+
# shellcheck source=contrib/guix/libexec/prelude.bash
1010
source "$(dirname "${BASH_SOURCE[0]}")/libexec/prelude.bash"
1111

1212

contrib/guix/guix-verify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e -o pipefail
66
# 1. Checks if we're at the top directory of the Bitcoin Core repository
77
# 2. Defines a few common functions and variables
88
#
9-
# shellcheck source=libexec/prelude.bash
9+
# shellcheck source=contrib/guix/libexec/prelude.bash
1010
source "$(dirname "${BASH_SOURCE[0]}")/libexec/prelude.bash"
1111

1212

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ fi
2525
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
2626
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
2727
SOURCED_FILES=$(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}') # Check shellcheck directive used for sourced files
28-
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $SOURCED_FILES $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|minisketch|univalue)/'); then
28+
mapfile -t GUIX_FILES < <(git ls-files contrib/guix contrib/shell | xargs gawk '/^#!\/usr\/bin\/env bash/ {print FILENAME} {nextfile}')
29+
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $SOURCED_FILES "${GUIX_FILES[@]}" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|minisketch|univalue)/'); then
2930
EXIT_CODE=1
3031
fi
3132

0 commit comments

Comments
 (0)