-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlefthook.yml
More file actions
85 lines (81 loc) · 3.26 KB
/
Copy pathlefthook.yml
File metadata and controls
85 lines (81 loc) · 3.26 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
pre-commit:
parallel: true
commands:
eslint:
glob: '**/*.{js,ts,jsx,tsx}'
run: |
echo "🔍 ========================================="
echo "🔧 Running ESLint on staged files..."
echo "🔍 ========================================="
pnpm exec eslint {staged_files} --fix || exit 1
echo "✅ ESLint completed successfully!"
stage_fixed: true
prettier:
glob: '**/*.{js,ts,jsx,tsx,json,yaml,md,css}'
run: |
echo "💅 ========================================="
echo "🎨 Running Prettier on staged files..."
echo "💅 ========================================="
pnpm exec prettier --write {staged_files} || exit 1
echo "✅ Code formatting completed!"
stage_fixed: true
type-check:
run: |
echo "🔍 ========================================="
echo "📝 Running TypeScript type checking..."
echo "🔍 ========================================="
pnpm type-check || exit 1
echo "✅ Type checking completed successfully!"
prepare-commit-msg: # 원래는 아예 필요가 없음, 하지만 추후 gitmoji 자동 생성을 위해 남겨둡니다.
commands:
add-prefix:
run: |
echo "📝 ========================================="
echo "🏷️ Preparing commit message..."
echo "📝 ========================================="
node scripts/prepare-commit-msg.cjs {{1}} || exit 1
echo "✅ Commit message prepared!"
commit-msg:
commands:
lint-message:
run: |
echo "📋 ========================================="
echo "🔍 Validating commit message format..."
echo "📋 ========================================="
node scripts/run-commitlint.cjs {{1}} || exit 1
echo "✅ Commit message validation passed!"
pre-rebase:
commands:
check-clean:
run: |
echo "🔄 ========================================="
echo "🧹 Checking repository cleanliness..."
echo "🔄 ========================================="
node scripts/pre-rebase-check.cjs || exit 1
echo "✅ Repository clean check completed!"
pre-push:
commands:
build:
run: |
echo "🚀 ========================================="
echo "🚀 Starting build for push verification..."
echo "🚀 ========================================="
echo "📊 Step 1/2: Running type check..."
if pnpm type-check; then
echo "✅ Type check passed successfully!"
echo "📊 Step 2/2: Building project..."
echo "🔨 ========================================="
echo "🏗️ Running production build..."
echo "🔨 ========================================="
pnpm build || exit 1
echo "🎉 ========================================="
echo "✅ Build completed successfully!"
echo "🚀 Ready to push!"
echo "🎉 ========================================="
else
echo "❌ ========================================="
echo "❌ Type check failed!"
echo "🚫 Build skipped - fix type errors first"
echo "❌ ========================================="
exit 1
fi