-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
26 lines (25 loc) · 879 Bytes
/
Copy pathlefthook.yml
File metadata and controls
26 lines (25 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pre-commit:
parallel: false
commands:
biome:
glob: "*.{ts,tsx,js,jsx,mts,cts}"
run: bunx biome check --write --staged {staged_files}
stage_fixed: true
commit-msg:
commands:
conventional-commits:
run: |
MSG=$(cat {1})
PATTERN="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?(!)?: .{1,100}"
if ! echo "$MSG" | grep -qE "$PATTERN"; then
echo ""
echo "❌ Commit message must follow Conventional Commits format."
echo " Examples:"
echo " feat: add user authentication"
echo " fix(auth): handle token expiry"
echo " chore!: drop support for Node 16"
echo ""
echo " Types: feat | fix | docs | style | refactor | perf | test | build | ci | chore | revert"
echo ""
exit 1
fi