Skip to contentSkip to conversation

Makefile: add check target to run shellcheck

RFC New Luis Chamberlain 1 participant 1 message Feb 8, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

RFC 1/1 Makefile: add check target to run shellcheck

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.

---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)
Makefile +7 -0
index f6f91a4d..a83e6879 100644
@@ -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
Signature · 1 line
2.34.1