chore: add local git hooks

- lint commit messages
This commit is contained in:
2020-10-26 16:28:20 +01:00
parent caa152748b
commit 23586ca5d7
7 changed files with 1333 additions and 5 deletions

18
.githook/commit-msg Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -eo pipefail
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
export PATH="${PATH}:${DIR}/../node_modules/.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 $@