Message ID | 20220208214058.3724721-1-mcgrof@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RFC] Makefile: add check target to run shellcheck | expand |
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
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@kernel.org> --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+)