36 lines
1 KiB
YAML
36 lines
1 KiB
YAML
commit-msg:
|
|
commands:
|
|
validate:
|
|
run: |
|
|
msg=$(head -1 {1})
|
|
if ! echo "$msg" | grep -qE '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?(!)?: .{1,}$'; then
|
|
echo ""
|
|
echo "ERROR: Invalid commit message format."
|
|
echo ""
|
|
echo " Got: $msg"
|
|
echo ""
|
|
echo " Expected: <type>[optional scope][!]: <description>"
|
|
echo ""
|
|
echo " Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert"
|
|
echo " Examples:"
|
|
echo " feat: add new audio codec detection"
|
|
echo " fix(scanner): correct HDR10 detection for MKV files"
|
|
echo " feat!: redesign output format"
|
|
echo ""
|
|
exit 1
|
|
fi
|
|
|
|
pre-commit:
|
|
parallel: true
|
|
commands:
|
|
prettier:
|
|
glob: "*.{ts,js,json,md,yml,yaml}"
|
|
run: npx prettier --check {staged_files}
|
|
typecheck:
|
|
glob: "*.ts"
|
|
run: npx tsc --noEmit
|
|
|
|
pre-push:
|
|
commands:
|
|
test:
|
|
run: npm test
|