]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
Revert "Do not suppress any shellcheck warnings"
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 30 Aug 2023 10:41:34 +0000 (19:41 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 31 Aug 2023 02:02:03 +0000 (11:02 +0900)
This reverts commit 26664dff17b626550fae99181112f9ceff9bb971.

The commit enabled the shellcheck warning SC2119 based on the
understanding that bash would pass arguments list "$@" from caller to
callee when functions are called without arguments. However, it was not
correct then merit of SC2119 is not so important. On the other hand,
SC2119 reports false positive warning when bash functions take optional
arguments and they are called without arguments.

Per discussion on the list [1], we concluded that the merit of optional
arguments is larger than that of SC2119. Hence, disable SC2119 again.

[1] https://lore.kernel.org/linux-nvme/o5xnqvujzakhrudv7p64owiuzgozmean6blxow4vdxhdqozg5v@qznf2tzmey7k/

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Makefile

index 5a044793e39ca59df0b6ae017ce9339d7f3144a5..4bed1dac4e1022f55c215dab5ee1c3f99dd9bbda 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,9 @@ install:
        cp -R tests common $(dest)
        $(MAKE) -C src dest=$(dest)/src install
 
-SHELLCHECK_EXCLUDE := ""
+# SC2119: "Use foo "$@" if function's $1 should mean script's $1". False
+# positives on helpers like _init_scsi_debug.
+SHELLCHECK_EXCLUDE := SC2119
 
 check:
        shellcheck -x -e $(SHELLCHECK_EXCLUDE) -f gcc check new common/* \