Skip to content

Add lefthook for local pre-commit checks #51

Description

@Wikid82

Problem

`CLAUDE.md`'s Definition of Done references lint/test/coverage gates that all run in CI, but nothing enforces them locally before a commit is made — the project name-checks "lefthook" as the intended tool (per project convention) but no `lefthook.yml` exists yet, so a broken build/lint/test can be committed and only caught at CI/PR time.

Proposal

  • Add `lefthook` as a devDependency and a `lefthook.yml` at the repo root.
  • Wire a `pre-commit` hook running `npm run lint` (tsc --noEmit) and, at minimum, `vitest run` scoped to changed files (or the full fast suite, given the project's small size).
  • Add a `postinstall`/README step (`npx lefthook install`) so contributors get the hooks automatically after `npm install`.
  • Document the hook in `CLAUDE.md`'s Definition of Done section once it exists.

Notes

Keep it fast — a slow pre-commit hook gets bypassed. Consider running the full `npm run test:coverage`/patch-report only in CI, not on every commit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceCI, tooling, and repo-hygiene work

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions