From 8832a17f12995c48b9c61194085202fa0abf84bb Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Jan 2018 11:03:18 +0100 Subject: Add script to check commit message style --- scripts/hooks/commit-msg.checkstyle.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/hooks/commit-msg.checkstyle.sh (limited to 'scripts') diff --git a/scripts/hooks/commit-msg.checkstyle.sh b/scripts/hooks/commit-msg.checkstyle.sh new file mode 100644 index 00000000..e1644f6d --- /dev/null +++ b/scripts/hooks/commit-msg.checkstyle.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# An hook script to check the commit message for style +# +# To enable this hook, copy this file to ".git/hooks/commit-msg" and make it +# executable. + +. git-sh-setup + + +# +# +# Check for "WIP" in commit message and add "[skip ci]" if commit message +# contains a WIP. +# +# + +if grep -q -i -e "WIP" -e "work in progress" $1; then + read -p "You're about to add a WIP commit, do you want to run the CI? [y|n] " -n 1 -r < /dev/tty + echo + if echo $REPLY | grep -E '^[Nn]$' > /dev/null; then + echo "[skip ci]" >> $1 + fi +fi + -- cgit v1.2.3