Skip to content

Commit 8d52ba1

Browse files
committed
build.make: integrate shellcheck into "make test"
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.
1 parent 9e9b7be commit 8d52ba1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

build.make

+15
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,18 @@ test: test-subtree
122122
test-subtree:
123123
@ echo; echo "### $@:"
124124
./release-tools/verify-subtree.sh release-tools
125+
126+
# Components can extend the set of directories which must pass shellcheck.
127+
# The default is to check only the release-tools directory itself.
128+
TEST_SHELLCHECK_DIRS=release-tools
129+
.PHONY: test-shellcheck
130+
test: test-shellcheck
131+
test-shellcheck:
132+
@ echo; echo "### $@:"
133+
@ ret=0; \
134+
for dir in $(abspath $(TEST_SHELLCHECK_DIRS)); do \
135+
echo; \
136+
echo "$$dir:"; \
137+
./release-tools/verify-shellcheck.sh "$$dir" || ret=1; \
138+
done; \
139+
return $$ret

0 commit comments

Comments
 (0)