-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
31 lines (27 loc) · 815 Bytes
/
lefthook.yml
File metadata and controls
31 lines (27 loc) · 815 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
27
28
29
30
31
pre-commit:
parallel: true
commands:
lint:
glob: "*.{js,mjs,cjs,ts,svelte}"
run: npx eslint {staged_files} --max-warnings 0
typecheck:
glob: "*.{ts}"
run: npm run typecheck
decision-traceability:
run: TRACEABILITY_STAGED_ONLY=1 ./scripts/check-decision-traceability.sh
pre-push:
commands:
test:
run: npm test
commit-msg:
commands:
conventional:
run: |
commit_msg=$(cat {1})
pattern="^(feat|fix|refactor|chore|docs|style|test|perf|ci)(\(.+\))?: .{1,}"
if ! echo "$commit_msg" | grep -qE "$pattern"; then
echo "Invalid commit message format."
echo "Expected: <type>(<scope>): <description>"
echo "Types: feat, fix, refactor, chore, docs, style, test, perf, ci"
exit 1
fi