diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-29 14:45:33 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-29 14:45:33 +1200 |
commit | 1933e360a83a3fada24b378ca2dffe2818d224dd (patch) | |
tree | 0eaf939eabcfcf94a2d624eb9728a8b22e3ac9d2 | |
parent | Add first attempt at Git template dir (diff) | |
download | dotfiles-1933e360a83a3fada24b378ca2dffe2818d224dd.tar.gz dotfiles-1933e360a83a3fada24b378ca2dffe2818d224dd.zip |
Add check and lint targets for git template hooks
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | check/git-template-hooks.sh | 3 | ||||
-rw-r--r-- | lint/git-template-hooks.sh | 5 |
3 files changed, 16 insertions, 0 deletions
@@ -65,6 +65,7 @@ check-bash \ check-bin \ check-games \ + check-git-template-hooks \ check-ksh \ check-login-shell \ check-man \ @@ -76,6 +77,7 @@ lint-bash \ lint-bin \ lint-games \ + lint-git-template-hooks \ lint-ksh \ lint-sh \ lint-urxvt \ @@ -666,6 +668,9 @@ check-bin: $(BINS) check-games: $(GAMES) sh check/games.sh +check-git-template-hooks: $(GIT_TEMPLATE_HOOKS) + sh check/git-template-hooks.sh + check-man: sh check/man.sh @@ -705,6 +710,9 @@ lint-bin: check-bin lint-games: check-games sh lint/games.sh +lint-git-template-hooks: check-git-template-hooks + sh lint/git-template-hooks.sh + lint-ksh: check-ksh sh lint/ksh.sh diff --git a/check/git-template-hooks.sh b/check/git-template-hooks.sh new file mode 100644 index 00000000..42d3a69f --- /dev/null +++ b/check/git-template-hooks.sh @@ -0,0 +1,3 @@ +for sh in git/template/hooks/*.sh ; do + sh -n "${sh%.sh}" || exit +done diff --git a/lint/git-template-hooks.sh b/lint/git-template-hooks.sh new file mode 100644 index 00000000..74f20fc6 --- /dev/null +++ b/lint/git-template-hooks.sh @@ -0,0 +1,5 @@ +set -- +for bin in git/template/hooks/*.sh ; do + set -- "$@" "${bin%.sh}" +done +shellcheck -e SC1090 -- "$@" || exit |