Skip to content

Commit b9c8de2

Browse files
committed
Add rule to check shellcheck installation
1 parent 681c236 commit b9c8de2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tools/make/lib/lint/shell/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@ SHELL_LINTER_FLAGS ?=
2727

2828
# RULES #
2929

30+
#/
31+
# Checks whether [shellcheck][1] is installed.
32+
#
33+
# [1]: https://github.com/koalaman/shellcheck
34+
#
35+
# @private
36+
#
37+
# @example
38+
# make check-shellcheck
39+
#/
40+
check-shellcheck:
41+
ifeq (, $(shell command -v $(SHELLCHECK) 2>/dev/null))
42+
$(QUIET) echo ''
43+
$(QUIET) echo 'shellcheck is not installed. Please install shellcheck and try again.'
44+
$(QUIET) echo 'For install instructions, see https://github.com/koalaman/shellcheck'
45+
$(QUIET) echo 'and the project development guide.'
46+
$(QUIET) echo ''
47+
$(QUIET) exit 1
48+
else
49+
$(QUIET) echo 'shellcheck is installed.'
50+
$(QUIET) exit 0
51+
endif
52+
53+
.PHONY: check-shellcheck
54+
3055
#/
3156
# Lints shell script files.
3257
#

0 commit comments

Comments
 (0)