Skip to content

Commit

Permalink
Makefile: Add shellcheck recipe (#555)
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Roubert <[email protected]>
  • Loading branch information
joakimr-axis authored Jun 16, 2020
1 parent 78f3d10 commit 2f18efe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ ifdef CARGO_DEBUG
RUSTCFLAGS += -C debuginfo=2
endif

SHELLCHECK ?= shellcheck
SHELLCHECK_CMD = $(SHELLCHECK) -x -P "$(CURDIR)/profiling"

$(TARGET_BIN): fetch
$(CARGO_BUILD) -p linkerd2-proxy

Expand Down Expand Up @@ -79,6 +82,11 @@ check-fmt:
fmt:
$(CARGO_FMT)

.PHONY: shellcheck
shellcheck:
$(SHELLCHECK_CMD) $$(find "$(CURDIR)" -type f \
! -path "$(CURDIR)"/.git/hooks/\*.sample \
| while read -r f; do [ "$$(file -b --mime-type "$$f")" = 'text/x-shellscript' ] && printf '%s\0' "$$f"; done | xargs -0)

.PHONY: test-lib
test-lib:: fetch
Expand Down

0 comments on commit 2f18efe

Please sign in to comment.