-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit-msg
More file actions
executable file
·24 lines (21 loc) · 850 Bytes
/
commit-msg
File metadata and controls
executable file
·24 lines (21 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env sh
# Validate conventional commit format
commit_msg=$(cat "$1")
# Pattern for conventional commits: type(scope): subject
# Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert
if ! echo "$commit_msg" | grep -qE "^(feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert)(\(.+\))?: .+"; then
echo "❌ Invalid commit message format!"
echo ""
echo "Commit message must follow Conventional Commits format:"
echo " <type>(<scope>): <subject>"
echo ""
echo "Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert"
echo ""
echo "Examples:"
echo " feat(playwright): add manufacturer selection step"
echo " fix(tests): resolve timeout in basket validation"
echo " docs: update contributing guide"
echo ""
exit 1
fi
echo "✅ Commit message format is valid"