From 62efb7b8666d27476a816416f127db7b2162b073 Mon Sep 17 00:00:00 2001 From: Ritesh Ghosh Date: Wed, 2 Aug 2023 13:14:47 +0530 Subject: [PATCH] feat(husky): added husky commit-msg check --- .husky/commit-msg | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .husky/commit-msg 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