CONTRIBUTING never says npm install, so the pre-commit gate never gets installed #31

Closed
opened 2026-08-11 14:18:28 +00:00 by chrnx · 0 comments
Owner

The worked example in CONTRIBUTING.md goes from git clone straight to "... make the change ...". It never mentions npm install.

That matters more than a missing line usually would. The prepare script points core.hooksPath at .githooks/, and .githooks/pre-commit runs npm run lint and npm run complexity:check. A contributor who never installs, or installs in a way that skips lifecycle scripts, has no local gate at all. They find out from CI what the hook would have told them before the commit existed.

That is exactly what happened in https://github.com/Expressive-Tea/green-tea/pull/14: the complexity gate failed in CI, on a rule the docs never stated, on a branch whose author had no hook to catch it.

Two more gaps in the same file:

  • complexity:check and build are missing from the "Run what CI runs" list, though ci.yml runs both.
  • test:deno, test:bun and test:edge appear only in AGENTS.md and the README. CONTRIBUTING tells contributors that npm test does not cover the other runtimes and then never gives them the commands, so an assistant reading the repo is better briefed than the person sending the pull request.

The PR template checklist is stale in the same way.

Proposal: a ## Local setup section with the Node floor, npm install, how to confirm core.hooksPath took, and the three runtime commands. Sync both lists with ci.yml.

The worked example in `CONTRIBUTING.md` goes from `git clone` straight to "... make the change ...". It never mentions `npm install`. That matters more than a missing line usually would. The `prepare` script points `core.hooksPath` at `.githooks/`, and `.githooks/pre-commit` runs `npm run lint` and `npm run complexity:check`. A contributor who never installs, or installs in a way that skips lifecycle scripts, has no local gate at all. They find out from CI what the hook would have told them before the commit existed. That is exactly what happened in https://github.com/Expressive-Tea/green-tea/pull/14: the complexity gate failed in CI, on a rule the docs never stated, on a branch whose author had no hook to catch it. Two more gaps in the same file: - `complexity:check` and `build` are missing from the "Run what CI runs" list, though `ci.yml` runs both. - `test:deno`, `test:bun` and `test:edge` appear only in `AGENTS.md` and the README. CONTRIBUTING tells contributors that `npm test` does not cover the other runtimes and then never gives them the commands, so an assistant reading the repo is better briefed than the person sending the pull request. The PR template checklist is stale in the same way. **Proposal:** a `## Local setup` section with the Node floor, `npm install`, how to confirm `core.hooksPath` took, and the three runtime commands. Sync both lists with `ci.yml`.
chrnx closed this issue 2026-08-11 14:41:04 +00:00
Sign in to join this conversation.