Skip to content

Commit 45e386a

Browse files
committed
fix(qa): remove auto-fix from qa:all to prevent unstaged changes in hooks
Problem: Running qa:fix inside qa:all during git hooks causes auto-fixes without staging changes, leading to commits without the fixes. Solution: - qa:all now validation-only (no code modification) - Created qa:all:fix for manual workflow (fix → validate) - Updated hooks and CI docs to clarify validation-only behavior Rationale: - Git hooks should validate, not modify uncommitted code - CI should validate, not modify code (anti-pattern) - Manual workflow: run qa:all:fix, review changes, stage, commit Files: - .cursor/commands/qa/Taskfile.yml - Split validation from fixing - .github/workflows/ci.yml - Updated docs - .husky/pre-commit - Clarified validation-only - .husky/pre-push - Clarified validation-only
1 parent 32febac commit 45e386a

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

.cursor/commands/qa/Taskfile.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ tasks:
110110
- cd ../../../frontend && bun run test:e2e:ui
111111
silent: false
112112

113-
# Complete QA suite (THE definitive quality check)
113+
# Validation-only QA suite (for git hooks and CI)
114+
# Does NOT modify code - only validates
114115
all:
115-
desc: "Complete QA suite (fix + rules + smoke + lint + typecheck + unit + e2e)"
116+
desc: "Validation QA suite (rules + smoke + lint + typecheck + unit + e2e)"
116117
cmds:
117-
- echo "🎯 Running comprehensive QA suite..."
118-
- echo ""
119-
- task: fix
118+
- echo "🎯 Running validation QA suite (no auto-fix)..."
120119
- echo ""
121120
- task: rules:check
122121
- echo ""
@@ -130,7 +129,22 @@ tasks:
130129
- echo ""
131130
- task: e2e
132131
- echo ""
133-
- echo "🎉 All QA checks passed!"
132+
- echo "🎉 All validation checks passed!"
133+
silent: false
134+
135+
# Complete QA workflow (fix THEN validate)
136+
# Use this manually before committing
137+
all:fix:
138+
desc: "Complete workflow - auto-fix then validate (manual use only)"
139+
cmds:
140+
- echo "Step 1 - Auto-fixing issues..."
141+
- task: fix
142+
- echo ""
143+
- echo "Auto-fix complete. Review changes with git diff"
144+
- echo "Stage changes with git add . if satisfied"
145+
- echo ""
146+
- echo "Step 2 - Running validation suite..."
147+
- task: all
134148
silent: false
135149

136150
# Appium (mobile testing)

.github/workflows/ci.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,18 @@ jobs:
102102
# MIRRORS LOCAL: Exact same command developers run locally
103103
# DRY: No duplication - all logic in .cursor/commands/qa/Taskfile.yml
104104
#
105-
# What `task qa:all` runs:
106-
# 1. qa:fix - Auto-fix linting/formatting
107-
# 2. qa:rules - Validate founder rules (no console.log, no any, American spelling)
108-
# 3. qa:smoke - Health checks (backend + frontend)
109-
# 4. qa:lint - Linting (backend + frontend)
110-
# 5. qa:typecheck - TypeScript validation (frontend)
111-
# 6. qa:unit - Unit tests (backend only - encore test)
112-
# 7. qa:e2e - E2E tests (frontend Playwright)
105+
# What `task qa:all` runs (VALIDATION ONLY - no code modification):
106+
# 1. qa:rules - Validate founder rules (no console.log, no any, American spelling)
107+
# 2. qa:smoke - Health checks (backend + frontend)
108+
# 3. qa:lint - Linting (backend + frontend)
109+
# 4. qa:typecheck - TypeScript validation (frontend)
110+
# 5. qa:unit - Unit tests (backend only - encore test)
111+
# 6. qa:e2e - E2E tests (frontend Playwright)
112+
#
113+
# Note: Auto-fix (qa:fix) is intentionally excluded from qa:all
114+
# - Git hooks should validate, not modify uncommitted code
115+
# - CI should validate, not modify code (anti-pattern)
116+
# - Manual workflow: `task qa:all:fix` (fix → validate) before committing
113117
#
114118
# Dependencies:
115119
# - go-task - Taskfile runner

.husky/pre-commit

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
#!/bin/sh
22
# Husky pre-commit hook
3-
# Comprehensive QA suite BEFORE commit (coding agent safety)
3+
# Validation QA suite BEFORE commit (coding agent safety)
44
#
55
# WHY REDUNDANT: Coding agents can bypass guards and commit directly.
66
# Running qa:all here ensures quality checks at EVERY commit.
7+
#
8+
# IMPORTANT: qa:all is VALIDATION ONLY (does not modify code)
9+
# To auto-fix before committing, run: cd .cursor && task qa:all:fix
10+
# This will fix issues, show you the changes, and let you stage them.
711

8-
echo "🛠️ Running comprehensive QA suite before commit..."
12+
echo "🛠️ Running validation QA suite before commit..."
13+
echo " (Validation only - does not modify code)"
914
echo " (Redundant with pre-push for coding agent safety)"
1015
echo ""
1116
(cd .cursor && task qa:all) || exit 1
1217

1318
echo ""
14-
echo "✅ Pre-commit checks passed!"
19+
echo "✅ Pre-commit validation passed!"
1520

1621

.husky/pre-push

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#!/bin/sh
22
# Husky pre-push hook
3-
# Comprehensive QA suite + merge commit check
3+
# Validation QA suite + merge commit check
44
#
55
# WHY REDUNDANT: Coding agents can bypass pre-commit and push directly.
66
# Running qa:all here ensures quality checks at EVERY push.
7+
#
8+
# IMPORTANT: qa:all is VALIDATION ONLY (does not modify code)
9+
# To auto-fix before pushing, run: cd .cursor && task qa:all:fix
10+
# This will fix issues, show you the changes, and let you stage them.
711

8-
echo "🛠️ Running comprehensive QA suite before push..."
12+
echo "🛠️ Running validation QA suite before push..."
13+
echo " (Validation only - does not modify code)"
914
echo " (Redundant with pre-commit for coding agent safety)"
1015
echo ""
1116
(cd .cursor && task qa:all) || exit 1

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)