Skip to content

Commit

Permalink
zess: add pre-commit hook to check commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-dev committed Jun 10, 2024
1 parent 551a150 commit 0000001
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

commit_message=$(<"$1")

if ! [[ $commit_message =~ ^(vingo:|vinscant:|vinvoor:|zess:) ]]; then
echo "Error: commit message should start with vingo:|vinscant:|vinvoor:|zess: depending on which subproject you are working on."
exit 1
fi

if ! [[ $commit_message =~ ^.*:\ [a-z].* ]]; then
echo "Error: first letter after project specifier should be lower case
Example:
vingo: add cheese
^
| this one"
exit 1
fi

exit 0

0 comments on commit 0000001

Please sign in to comment.