chore(git): add commit validation git hook

This commit is contained in:
2020-08-09 08:10:19 +02:00
parent 8cd9bdad50
commit ae4e54453b
6 changed files with 1417 additions and 9 deletions

21
.githooks/commit-msg Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
set -eo pipefail
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
CLIENT_DIR="${DIR}/../client"
export NODE_PATH="${CLIENT_DIR}/node_modules"
export PATH="${PATH}:${NODE_PATH}/.bin"
function lint_commit_message {
local commit_message_file="$1"
( cat "$commit_message_file" | commitlint )
}
function main {
local commit_message_file="$1"
lint_commit_message "$commit_message_file"
}
main $@