-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
32 lines (30 loc) · 1.17 KB
/
Copy pathlefthook.yml
File metadata and controls
32 lines (30 loc) · 1.17 KB
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
32
# Lefthook 설정 — Git hook 관리
# 참고: https://lefthook.dev/configuration/
#
# pre-commit: staged 파일에만 빠른 검증 (prettier 자동 포매팅)
# pre-push: 전체 워크스페이스에 무거운 검증 (lint + type-check + test, turbo 캐시 활용)
#
# 우회: 긴급 시 `LEFTHOOK=0 git commit` 또는 `git commit --no-verify`
pre-commit:
parallel: true
commands:
prettier:
# 루트 파일(`*`)과 하위 디렉터리 파일(`**/*`) 둘 다 매치. `**/*.md`만 쓰면
# `/`가 리터럴이라 루트의 CLAUDE.md·README.md 같은 파일이 빠져 CI의
# format:check에서야 잡힌다(PR #262에서 실제로 그랬다).
glob: '{*,**/*}.{ts,mts,tsx,js,jsx,json,md,mjs,cjs,yml,yaml}'
# 포스트 콘텐츠는 .prettierignore 대상이고, 경로의 [시리즈명] 대괄호를
# prettier가 glob으로 해석해 exit 2가 나므로 훅 단계에서 제외
exclude:
- apps/blog/posts/**
run: pnpm exec prettier --write {staged_files} --ignore-unknown
stage_fixed: true
pre-push:
parallel: true
commands:
lint:
run: pnpm lint
types:
run: pnpm check-types
test:
run: pnpm test