makefile: add check-shell rule

The check-shell rule will use shellcheck to help ensure high quality
shell scripts.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2022-07-18 15:20:15 -04:00 committed by mergify[bot]
parent 86802199f8
commit f5d1adf26f
1 changed files with 8 additions and 2 deletions

View File

@ -205,9 +205,11 @@ $(RESULTS_DIR):
mkdir -p $(RESULTS_DIR)
endif
SHELL_SOURCES=entrypoint.sh micro-osd.sh
.PHONY: ci-image
ci-image: $(BUILDFILE)
$(BUILDFILE): $(CONTAINER_CONFIG_DIR)/Dockerfile entrypoint.sh micro-osd.sh
$(BUILDFILE): $(CONTAINER_CONFIG_DIR)/Dockerfile $(SHELL_SOURCES)
$(CONTAINER_CMD) build \
$(CONTAINER_BUILD_ARGS) \
$(CONTAINER_BUILD_OPTS) \
@ -216,7 +218,7 @@ $(BUILDFILE): $(CONTAINER_CONFIG_DIR)/Dockerfile entrypoint.sh micro-osd.sh
@$(CONTAINER_CMD) inspect -f '{{.Id}}' $(CI_IMAGE_TAG) > $(BUILDFILE)
echo $(CEPH_VERSION) >> $(BUILDFILE)
check: check-revive check-format
check: check-revive check-format check-shell
check-format:
! $(GOFMT_CMD) $(CHECK_GOFMT_FLAGS) . | sed 's,^,formatting error: ,' | grep 'go$$'
@ -226,6 +228,10 @@ check-revive:
# See: https://github.com/mgechev/revive
revive -config .revive.toml $$(find . -name '*.go')
check-shell:
shellcheck -fgcc $(SHELL_SOURCES)
# Do a quick compile only check of the tests and impliclity the
# library code as well.
test-binaries: \