mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Add --enable=all to ShellCheck by default
Change enforced shell type from `dash` to `sh` and excluded `SC2039` and `SC3043` by default. `local` keyword is accepted by all POSIX shells from practical point of view. There is no need anymore to enforce dash so `local` is accepted. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes #13020
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
.PHONY: shellcheck
|
||||
shellcheck: $(SCRIPTS) $(SHELLCHECKSCRIPTS)
|
||||
|
||||
# ShellCheck exclusions
|
||||
#
|
||||
# ShellCheck can't follow non-constant source. Use a directive to specify location. [SC1090]
|
||||
# Not following: a was not specified as input (see shellcheck -x). [SC1091]
|
||||
# Prefer putting braces around variable references even when not strictly required. [SC2250]
|
||||
# In POSIX sh, 'local' is undefined. [SC2039] # older ShellCheck versions
|
||||
# In POSIX sh, 'local' is undefined. [SC3043] # newer ShellCheck versions
|
||||
if HAVE_SHELLCHECK
|
||||
[ -z "$(SCRIPTS)$(SHELLCHECKSCRIPTS)" ] && exit; shellcheck --format=gcc --exclude=SC1090,SC1091,SC2250 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") $(SHELLCHECK_OPTS) $(SCRIPTS) $(SHELLCHECKSCRIPTS)
|
||||
[ -z "$(SCRIPTS)$(SHELLCHECKSCRIPTS)" ] && exit; shellcheck --format=gcc --enable=all --exclude=SC1090,SC1091,SC2039,SC2250,SC3043 $$([ -n "$(SHELLCHECK_SHELL)" ] && echo "--shell=$(SHELLCHECK_SHELL)") $(SHELLCHECK_OPTS) $(SCRIPTS) $(SHELLCHECKSCRIPTS)
|
||||
else
|
||||
@[ -z "$(SCRIPTS)$(SHELLCHECKSCRIPTS)" ] && exit; echo "skipping shellcheck of" $(SCRIPTS) $(SHELLCHECKSCRIPTS) "because shellcheck is not installed"
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user