jjb: babeltrace: ignore shellcheck warnings
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 8 Mar 2023 20:50:06 +0000 (15:50 -0500)
committerMichael Jeanson <mjeanson@efficios.com>
Wed, 8 Mar 2023 21:15:46 +0000 (16:15 -0500)
Ignore the warnings shellcheck gives, the rationale is in comments.

Change-Id: Icd8358e00de206b254cb2540d0b3df54893a5bb8
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
scripts/babeltrace/build.sh

index d9fb96912144ff1eb34a5fe9f1e2f1a45d8243d0..df29e93e60c38b36627331af542276d680e3a8af 100755 (executable)
@@ -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" ]
This page took 0.02393 seconds and 4 git commands to generate.