aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRitesh Ghosh <[email protected]>2023-08-02 13:14:47 +0530
committerRitesh Ghosh <[email protected]>2023-08-02 13:14:47 +0530
commit62efb7b8666d27476a816416f127db7b2162b073 (patch)
tree5de575cdf19c595b6010882486908cbb0b989974
parent121511bb72ffc5efa272b48fda448d465748c137 (diff)
downloadaniwatch-api-62efb7b8666d27476a816416f127db7b2162b073.tar.xz
aniwatch-api-62efb7b8666d27476a816416f127db7b2162b073.zip
feat(husky): added husky commit-msg check
-rw-r--r--.husky/commit-msg9
1 files changed, 9 insertions, 0 deletions
diff --git a/.husky/commit-msg b/.husky/commit-msg
new file mode 100644
index 0000000..d3d279d
--- /dev/null
+++ b/.husky/commit-msg
@@ -0,0 +1,9 @@
+#!/bin/sh
+if ! head -1 "$1" | grep -qE "^(feat|fix|chore|docs|test|style|refactor|perf|build|ci|revert)(\(.+?\))?: .{1,}$"; then
+ echo "Aborting commit. Your commit message is invalid." >&2
+ exit 1
+fi
+if ! head -1 "$1" | grep -qE "^.{1,88}$"; then
+ echo "Aborting commit. Your commit message is too long." >&2
+ exit 1
+fi