Skip to content

Commit

Permalink
Rewrite Makefile shellcheck rule to find all shell scripts
Browse files Browse the repository at this point in the history
Rewrite the find command which determines which files are
passed to shellcheck in order to include any file with a
shell-like shebang, since not all shell scripts have a
".sh" or ".ksh" extension

Signed-off-by: Gabriel A. Devenyi <gdevenyi@gmail.com>
  • Loading branch information
gdevenyi committed Jun 29, 2020
1 parent 2ac6aa1 commit 6997a51
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@ PHONY += shellcheck
shellcheck:
@if type shellcheck > /dev/null 2>&1; then \
shellcheck --exclude=SC1090 --exclude=SC1117 --format=gcc \
$$(find ${top_srcdir}/scripts/*.sh -type f) \
$$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
$$(find ${top_srcdir}/cmd/zpool/zpool.d/* \
-type f ${filter_executable}); \
$$(find ${top_srcdir} -name '.git' -o -name 'build' -prune -o \
-type f ! -name 'configure*' \
-exec bash -c 'awk "NR==1 && /sh/ {print FILENAME;}" "{}"' \;); \
else \
echo "skipping shellcheck because shellcheck is not installed"; \
fi
Expand Down

0 comments on commit 6997a51

Please sign in to comment.