From 79717bd2cd981bae078bf5c8ce650043c5016fe8 Mon Sep 17 00:00:00 2001 From: William Douglas Date: Wed, 26 Mar 2025 14:25:44 -0700 Subject: [PATCH] Fix up shellcheck issues The mechanism used to convert bats tests to something shellcheck can verify caused a large number of failures due to the introduction of testing for if a call is possible. Given the tests aren't called in a normal shell script way, it is best to just ignore this error for bats files. Also fix an index using '$' unnecessarily. Signed-off-by: William Douglas --- scripts/shellcheck.bash | 2 +- test/real_content/real_content_lib.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/shellcheck.bash b/scripts/shellcheck.bash index 7db77a0f..1f95a5ed 100755 --- a/scripts/shellcheck.bash +++ b/scripts/shellcheck.bash @@ -27,7 +27,7 @@ file="$1" if [[ "${file/*./}" == "bats" ]]; then sed 's/^@.*/func() {/' "$file" | sed 's/^load.*/source test\/functional\/testlib.bash/' | - shellcheck -s bash -x -e SC1008,SC2119 /dev/stdin + shellcheck -s bash -x -e SC1008,SC2119,SC2317 /dev/stdin else shellcheck -x "$file" -e SC2119 fi diff --git a/test/real_content/real_content_lib.bash b/test/real_content/real_content_lib.bash index bee4a01a..07263938 100644 --- a/test/real_content/real_content_lib.bash +++ b/test/real_content/real_content_lib.bash @@ -133,7 +133,7 @@ test_setup() { continue fi - VERSION[$i]=$v + VERSION[i]=$v i=$((i+1)) done