From 6946ebc05cf7251a905c1de6901f6208c37531cd Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 8 Mar 2023 15:50:06 -0500 Subject: [PATCH] jjb: babeltrace: ignore shellcheck warnings Ignore the warnings shellcheck gives, the rationale is in comments. Change-Id: Icd8358e00de206b254cb2540d0b3df54893a5bb8 Signed-off-by: Michael Jeanson --- scripts/babeltrace/build.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh index d9fb969..df29e93 100755 --- a/scripts/babeltrace/build.sh +++ b/scripts/babeltrace/build.sh @@ -25,6 +25,8 @@ vercomp () { return 0 fi local IFS=. + # Ignore the shellcheck warning, we want splitting to happen based on IFS. + # shellcheck disable=SC2206 local i ver1=($1) ver2=($2) # fill empty fields in ver1 with zeros for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do @@ -46,26 +48,35 @@ vercomp () { return 0 } +# Shellcheck flags the following functions that are unused as "unreachable", +# ignore that. + +# shellcheck disable=SC2317 verlte() { - vercomp "$1" "$2"; local res="$?" + vercomp "$1" "$2" + local res="$?" [ "$res" -eq "0" ] || [ "$res" -eq "2" ] } +# shellcheck disable=SC2317 verlt() { vercomp "$1" "$2"; local res="$?" [ "$res" -eq "2" ] } +# shellcheck disable=SC2317 vergte() { vercomp "$1" "$2"; local res="$?" [ "$res" -eq "0" ] || [ "$res" -eq "1" ] } +# shellcheck disable=SC2317 vergt() { vercomp "$1" "$2"; local res="$?" [ "$res" -eq "1" ] } +# shellcheck disable=SC2317 verne() { vercomp "$1" "$2"; local res="$?" [ "$res" -ne "0" ] -- 2.34.1