Skip to content

Commit a7937be

Browse files
enkoclaude
andcommitted
chore(dx): Align git hooks with CI pipeline
- Pre-push now runs identical checks to CI (check, type-check, test, build) - Pre-commit runs all checks except tests for faster commits - Added explicit error handling with exit codes - Added progress output for better visibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8381ad0 commit a7937be

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

.husky/pre-commit

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
#!/usr/bin/env sh
22

3-
# Run Biome check and format on staged files
4-
pnpm biome check --write --staged --no-errors-on-unmatched
3+
# Pre-commit hook: Run all CI checks except tests
4+
# Tests run on pre-push to keep commits fast
55

6-
pnpm run type-check
7-
pnpm run test
6+
echo "🔍 Running pre-commit checks..."
7+
8+
echo ""
9+
echo "📋 Step 1/3: Biome check (lint + format) on staged files..."
10+
pnpm biome check --write --staged --no-errors-on-unmatched || exit 1
11+
12+
echo ""
13+
echo "📋 Step 2/3: TypeScript type check..."
14+
pnpm run type-check || exit 1
15+
16+
echo ""
17+
echo "📋 Step 3/3: Build verification..."
18+
pnpm run build || exit 1
19+
20+
echo ""
21+
echo "✅ All pre-commit checks passed!"

.husky/pre-push

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
#!/usr/bin/env sh
22

3-
# Run all tests before push (trunk-based development requirement)
4-
pnpm test
5-
pnpm run lint
6-
pnpm run type-check
3+
# Pre-push hook: Run the same checks as CI
4+
# This ensures local validation matches CI pipeline exactly
5+
6+
echo "🔍 Running pre-push checks (same as CI)..."
7+
8+
echo ""
9+
echo "📋 Step 1/4: Biome check (lint + format)..."
10+
pnpm run check || exit 1
11+
12+
echo ""
13+
echo "📋 Step 2/4: TypeScript type check..."
14+
pnpm run type-check || exit 1
15+
16+
echo ""
17+
echo "📋 Step 3/4: Running tests..."
18+
pnpm run test || exit 1
19+
20+
echo ""
21+
echo "📋 Step 4/4: Build verification..."
22+
pnpm run build || exit 1
23+
24+
echo ""
25+
echo "✅ All pre-push checks passed!"

0 commit comments

Comments
 (0)