commit-msg
445 Bytes
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# 验证 commit 信息格式(可选)
# commit_regex='^(feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\(.+\))?: .{1,50}'
#
#if ! grep -qE "$commit_regex" "$1"; then
# echo "❌ Commit 信息格式不正确"
# echo "✅ 正确格式: type(scope): subject"
# echo "📝 类型: feat, fix, docs, style, refactor, test, chore, etc."
# exit 1
#fi
echo "✅ Commit 信息验证通过"