rules.mk: Add targets to check shell syntax
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m33s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m23s
CI / Packaging test (push) Successful in 0s
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m33s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m23s
CI / Packaging test (push) Successful in 0s
Add the target sh-syntax-check, which triggers bash syntax linting with shellcheck This commit stops short of making target all depend on it, because the fallout is impressive.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
e59d37e907
commit
3aecb6c685
2 changed files with 25 additions and 0 deletions
|
|
@ -98,6 +98,14 @@ endif
|
|||
ifndef PRISTINE_MAKE
|
||||
PRISTINE_MAKE := umask $(MINIMAL_UMASK) && MAKEFLAGS=$(MINIMAL_MAKEFLAGS) LD_LIBRARY_PATH=$(MINIMAL_LD_LIBRARY_PATH) PATH=$(MINIMAL_PATH) $(MAKE)
|
||||
endif
|
||||
ifndef SHELLCHECK
|
||||
SHELLCHECK := $(shell $(WHICH) shellcheck)
|
||||
endif
|
||||
ifdef SHELLCHECK
|
||||
SHELLCHECK += -f gcc
|
||||
else
|
||||
SHELLCHECK := bash -n
|
||||
endif
|
||||
|
||||
# ----- Function definitions
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ distclean: clean
|
|||
%.this \
|
||||
allclean \
|
||||
checkroot \
|
||||
check-syntax \
|
||||
collect \
|
||||
coreclean \
|
||||
depclean \
|
||||
|
|
@ -39,6 +40,7 @@ distclean: clean
|
|||
rccclean \
|
||||
remake \
|
||||
runclean \
|
||||
sh-check-syntax \
|
||||
textclean \
|
||||
tmpclean \
|
||||
uicclean \
|
||||
|
|
@ -430,4 +432,19 @@ find:
|
|||
collect:
|
||||
bash $(JWB_SCRIPT_DIR)/collect-installed-pkg-changes.sh -t $(TOPDIR)
|
||||
|
||||
check: check-syntax
|
||||
check-syntax: sh-check-syntax
|
||||
sh-check-syntax:
|
||||
|
||||
ifneq ($(strip $(EXE_SH)),)
|
||||
$(info EXE_SH=>$(EXE_SH)<)
|
||||
sh-check-syntax: sh-check-syntax-rule
|
||||
sh-check-syntax-rule: $(EXE_SH)
|
||||
$(SHELLCHECK) $^
|
||||
set -e; for script in $^; do \
|
||||
echo "Checking $$script" ;\
|
||||
$(SHELLCHECK) $$script ;\
|
||||
done
|
||||
endif
|
||||
|
||||
endif # ifndef JW_PKG_RULES_MK_INCLUDED
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue