-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
25 lines (24 loc) · 939 Bytes
/
lefthook.yml
File metadata and controls
25 lines (24 loc) · 939 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
commit-msg:
commands:
conventional-commit:
run: |
commit_msg=$(cat {1})
pattern="^(feat|fix|docs|style|refactor|test|ci|chore|revert|agents)(\(.+\))?: .{1,}"
if ! echo "$commit_msg" | grep -qE "$pattern"; then
if ! echo "$commit_msg" | grep -qE "^Merge "; then
echo "❌ Commit message must follow Conventional Commits format:"
echo " type(scope)?: description"
echo ""
echo " Types: feat, fix, docs, style, refactor, test, ci, chore, revert, agents"
echo " Example: feat: add new feature"
echo " Example: fix(api): resolve bug"
exit 1
fi
fi
pre-commit:
parallel: true
commands:
biome-check:
glob: "*.{ts,js,mjs,json}"
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
stage_fixed: true