Skip to content

Commit 13ec73a

Browse files
authored
shellcheck: disable "unreachable command" check [SC2317]
This new check in 0.9.0 appears to have some issues with various forms of "early return", like trap, exit and return. This is tripping up (at least): cmd/zed/zed.d/history_event-zfs-list-cacher.sh /etc/zfs/zfs-functions Its not obvious what its complaining about or what the remedy is, so it seems sensible to disable this check for now. See also: https://www.shellcheck.net/wiki/SC2317 koalaman/shellcheck#2542 koalaman/shellcheck#2613 Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #15089
1 parent 46adb28 commit 13ec73a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config/Shellcheck.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Not following: a was not specified as input (see shellcheck -x). [SC1091]
55
# Prefer putting braces around variable references even when not strictly required. [SC2250]
66
# Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). [SC2312]
7+
# Command appears to be unreachable. Check usage (or ignore if invoked indirectly). [SC2317]
78
# In POSIX sh, 'local' is undefined. [SC2039] # older ShellCheck versions
89
# In POSIX sh, 'local' is undefined. [SC3043] # newer ShellCheck versions
910

@@ -18,7 +19,7 @@ PHONY += shellcheck
1819
_STGT = $(subst ^,/,$(subst shellcheck-here-,,$@))
1920
shellcheck-here-%:
2021
if HAVE_SHELLCHECK
21-
shellcheck --format=gcc --enable=all --exclude=SC1090,SC1091,SC2039,SC2250,SC2312,SC3043 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") "$$([ -e "$(_STGT)" ] || echo "$(srcdir)/")$(_STGT)"
22+
shellcheck --format=gcc --enable=all --exclude=SC1090,SC1091,SC2039,SC2250,SC2312,SC2317,SC3043 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") "$$([ -e "$(_STGT)" ] || echo "$(srcdir)/")$(_STGT)"
2223
else
2324
@echo "skipping shellcheck of" $(_STGT) "because shellcheck is not installed"
2425
endif

0 commit comments

Comments
 (0)