Skip to content

Commit

Permalink
build.make: integrate shellcheck into "make test"
Browse files Browse the repository at this point in the history
By default this only tests the scripts inside the "release-tools"
directory, which is useful when making experimental changes to them in
a component that uses csi-release-tools. But a component can also
enable checking for other directories.
  • Loading branch information
pohly committed Mar 26, 2019
1 parent 9e9b7be commit 8d52ba1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions build.make
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,18 @@ test: test-subtree
test-subtree:
@ echo; echo "### $@:"
./release-tools/verify-subtree.sh release-tools

# Components can extend the set of directories which must pass shellcheck.
# The default is to check only the release-tools directory itself.
TEST_SHELLCHECK_DIRS=release-tools
.PHONY: test-shellcheck
test: test-shellcheck
test-shellcheck:
@ echo; echo "### $@:"
@ ret=0; \
for dir in $(abspath $(TEST_SHELLCHECK_DIRS)); do \
echo; \
echo "$$dir:"; \
./release-tools/verify-shellcheck.sh "$$dir" || ret=1; \
done; \
return $$ret

0 comments on commit 8d52ba1

Please sign in to comment.