Skip to main content

PR Checklist

Every pull request must pass a set of local checks before it is created. This page covers the required commands, branch naming rules, and commit conventions.

Pre-PR Checks

Run all four checks locally before pushing your branch. Every check must pass with zero errors.

1. Lint

Must complete with 0 errors. Warnings are acceptable but should be minimized.

2. Type Check

Ensures all TypeScript types compile correctly without emitting output files.

3. Unit Tests

All unit tests must pass. To run only unit tests:

4. Production Build

The Next.js production build must complete successfully. This catches issues that lint and type-check may miss (e.g., missing imports in server components, build-time errors).

Quick All-in-One Command

Run all checks in sequence. If any step fails, the chain stops:
The npm run build step is omitted from the one-liner since it takes longer. Run it separately after the quick checks pass.

Branch Naming

All work must be done on a feature branch. Branch names follow this convention:
PrefixUsageExample
feat/New featuresfeat/toll-reconciliation
fix/Bug fixesfix/csv-date-parsing
refactor/Code refactoringrefactor/kpi-calculations
chore/Maintenance taskschore/update-dependencies
docs/Documentation onlydocs/api-routes
ci/CI/CD changesci/playwright-setup

Commit Message Format

Use conventional commits:
TypeWhen to Use
featNew feature
fixBug fix
refactorCode change that neither fixes a bug nor adds a feature
choreBuild, tooling, or dependency changes
docsDocumentation changes
testAdding or updating tests
ciCI/CD pipeline changes
styleFormatting, whitespace (no code logic change)
Examples:

Branch Protection Rules

These rules are enforced and have no exceptions:
Never push directly to main. All changes must go through a feature branch and pull request. This applies to every change, no matter how small.
  • Never run git push origin main or git push --force origin main
  • Never use --no-verify to bypass hooks when pushing to main
  • Never force push to main under any circumstances
  • Always create a feature branch first, push to it, then open a PR

Git Rules

  • Do not add Co-Authored-By lines to commit messages
  • Keep commit messages concise and descriptive
  • Squash trivial fix-up commits before requesting review

Workflow Summary

What GitHub Actions Will Check

When you open a PR, the CI pipeline runs the same checks:
  1. npm run lint — Lint errors fail the build
  2. npx tsc --noEmit — Type errors fail the build
  3. npm run test -- --run — Test failures fail the build
  4. npm run build — Build errors fail the build
  5. Playwright E2E tests — Run against the preview deployment
Running checks locally before pushing saves CI minutes and avoids failed builds.