[RFC] Makefile: add check target to run shellcheck

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



shellcheck can be used to allow us to create a sanity check
on shell scripts and also build a consistent set of rules.
Although I actually find some annoying, consistancy is better
than no consitancy check at all. This is inspired by blktests'
own adoption of it and how it has found minor issues.

Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index f6f91a4d..a83e6879 100644
--- a/Makefile
+++ b/Makefile
@@ -99,6 +99,13 @@ else
 	$(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR)
 endif
 
+# We use shellcheck for sanity and consistency. Consistency is better than
+# not having any.
+check:
+	shellcheck -x -f gcc check new common/* \
+                tests/*/[0-9]*[0-9]
+.PHONY: check
+
 $(SRCTAR) : default
 	$(Q)git archive --prefix=$(PKG_NAME)-$(PKG_VERSION)/ --format=tar \
 	  v$(PKG_VERSION) > $(PKG_NAME)-$(PKG_VERSION).tar
-- 
2.34.1




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux