2.6 KiB
2.6 KiB
name, description
| name | description |
|---|---|
| verify | Run format, typecheck, test, and lint across the monorepo. Use after implementing changes. |
Verify
Run the full verification pipeline for the monorepo, then fix any issues found.
Steps
-
Rebase on main (ensures CI parity — CI merges main into the PR branch):
git fetch origin main --quiet- If the current branch is
main, skip this step. - If the branch is stacked on another feature branch (not main), skip this step.
Detect:
git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null— if the upstream is NOTorigin/main(e.g., another feature branch), skip rebase. - Otherwise, rebase:
git rebase origin/main - If the rebase has conflicts, resolve them:
- For each conflicted file, read the file and understand both sides of the conflict
- Resolve by keeping the correct combination of both changes (don't just pick one side)
git add <resolved-file>thengit rebase --continue- Repeat for each conflicting commit until the rebase completes
- If a conflict is too ambiguous to resolve confidently, abort (
git rebase --abort) and ask the user for guidance
- If the current branch is
-
Format (prevents formatter-induced lint failures):
make -C apps/backend fmtcd apps && pnpm format
-
Verify in parallel where possible:
make -C apps/backend test lintcd apps && pnpm --filter @kandev/web typecheck && pnpm --filter @kandev/web lint
-
Fix issues — do NOT just report them:
- Read each failing file at the reported line number
- Fix the root cause (don't suppress warnings or add ignores)
- Common fixes:
- Type errors: fix the type, add a missing import, or correct the function signature
- Lint — function too long: extract a helper function or sub-component
- Lint — file too long: split the file into smaller, cohesive files grouped by responsibility (e.g., separate types, helpers, constants, or sub-domains into their own files)
- Lint — cyclomatic/cognitive complexity: simplify conditionals, extract early returns, break into smaller functions
- Lint — unused imports: remove them
- Lint — duplicate strings: extract to a constant
- Test failures: read the test, understand the assertion, fix the code (not the test) unless the test is outdated
- After fixing, re-run only the failed command to confirm the fix
-
Repeat steps 3-4 until all commands pass. If a fix introduces new issues, address those too.
-
Done when all pass cleanly: rebase, fmt, typecheck, test, lint.