Skip to content

Commit 23b74dd

Browse files
committed
tests: shellcheck: disable unreachable code warning
Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a77f070 commit 23b74dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/patch/shellcheck/shellcheck.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
HEAD=$(git rev-parse HEAD)
55
rc=0
66

7+
# SC2317 = unreachable code, gets confused by test case definitions
8+
SC_FLAGS="-x -e SC2317"
9+
710
pr() {
811
echo " ====== $* ======" | tee -a /dev/stderr
912
}
@@ -40,7 +43,7 @@ for f in $(git show --diff-filter=M --pretty="" --name-only "${HEAD}" | grep -E
4043
cd "$(dirname "$f")" || exit 1
4144
sha="${tmpfile_o}_${sha}"
4245
rm -f "${sha}"
43-
shellcheck -x "$(basename "$f")" | tee -a "${tmpfile_o}" "${sha}"
46+
shellcheck $SC_FLAGS "$(basename "$f")" | tee -a "${tmpfile_o}" "${sha}"
4447
echo
4548
)
4649
done
@@ -64,7 +67,7 @@ for f in $(git show --diff-filter=AM --pretty="" --name-only "${HEAD}" | grep -E
6467
cd "$(dirname "$f")" || exit 1
6568
sha="${tmpfile_n}_${sha}"
6669
rm -f "${sha}"
67-
shellcheck -x "$(basename "$f")" | tee -a "${tmpfile_n}" "${sha}"
70+
shellcheck $SC_FLAGS "$(basename "$f")" | tee -a "${tmpfile_n}" "${sha}"
6871
echo
6972
)
7073
done

0 commit comments

Comments
 (0)