From a469c1ef50d0c03b93add44e50afa5d791855106 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 31 Oct 2017 21:52:24 +1300 Subject: Adjust `check-bin`, `lint-bin` for built scripts Make the `$(BINS)` target a prerequisite of `check-bin` so that all of the scripts with a #!/bin/sh shebang are built, and then check them all by iterating through a glob (and hence an order according to LC_COLLATE) and stripping the `.sh` suffix to find the name of the matching shebanged script. Leverage `shellcheck`'s support of multiple check arguments to build an argument list of the binscripts first before passing all of those to a single call, simply for speed. We don't have anything in this target to test the scripts of any other type, such as the `.awk` or `.sed` scripts. `gawk` has a `--lint` mode that might apply. --- lint/bin.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lint') diff --git a/lint/bin.sh b/lint/bin.sh index 0fe82d7a..16facb6a 100644 --- a/lint/bin.sh +++ b/lint/bin.sh @@ -1 +1,5 @@ -find bin -type f -name '*.sh' -print -exec shellcheck -e SC1090 -s sh -- {} + +set -- +for sh in bin/*.sh ; do + set "$@" "${sh%.sh}" +done +shellcheck -e SC1090 -- "$@" -- cgit v1.2.3