aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTurbo Fredriksson <[email protected]>2015-05-18 20:49:24 +0200
committerBrian Behlendorf <[email protected]>2015-05-20 14:10:03 -0700
commitc11cd7f9348005232ca62ccbeabbd30e396861ac (patch)
tree043ffa35370ed87214f199c75cd2b6fdaf9cdc93
parent141b6381d38a16a6178edcec8ace28d1f23b884e (diff)
Style check shell scripts
If the command "shellcheck" exists, then find all shell scripts and run shellcheck on them. * Use 'gcc' format with shellcheck. * Exclude zfs-script-config.sh (which isn't really a script). Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3428
-rw-r--r--Makefile.am14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 49b417a81..788122d2a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,10 +40,22 @@ dist-hook:
sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
$(distdir)/META
-checkstyle:
+checkstyle: cstyle shellcheck
+
+cstyle:
@find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
! -name '*.mod.c' -type f -exec scripts/cstyle.pl {} \+
+shellcheck:
+ @if type shellcheck > /dev/null 2>&1; then \
+ (find ${top_srcdir} -type f -name '*.sh.in' -o -type f \
+ -name '*.sh'; find etc/init.d/zfs*.in -type f) | \
+ grep -v 'zfs-script-config' | \
+ while read file; do \
+ shellcheck --format gcc "$$file"; \
+ done; \
+ fi
+
ctags:
$(RM) $(top_srcdir)/tags
find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags