Part of #26
.githooks/pre-commit checks formatting only. frontend/test/notices.test.js holds src-tauri/THIRD-PARTY-NOTICES.txt to what the lockfiles name, so a backend-only commit that adds a crate reddens the frontend suite: 3a2fffc went in red that way, because the worker ran cargo and named-paths only, and 9b26a0a fixed it a commit later. frontend/test/named-paths.test.js refuses a document file name until it is in PLACEHOLDERS, and two commits went in red on it, chained after a Vitest run with ; instead of gated on its exit.
Done when the hook, on a staged Cargo.lock, Cargo.toml or frontend/package-lock.json, runs npx vitest run notices in frontend/, and on any staged .rs, .js, .mjs or .md runs npx vitest run named-paths, refusing on red; both take seconds. CLAUDE.md's Commands line about the hook says what it refuses now. Left out: the whole Vitest suite on commit, which takes every core on this machine and belongs to the suite wrapper, another child of #26.
Done in ec3dd2a. The pre-commit hook now runs
vitest run noticesinfrontend/whenCargo.lock, anyCargo.toml,frontend/package-lock.jsonor what the notices are made from is staged. It runsvitest run named-pathswhen a staged file is one that test reads. Each red refuses the commit with a line naming it. A frontend without Vitest refuses rather than skips. The two runs take about four seconds. CLAUDE.md's Commands line says what the hook refuses now.Where this goes further than the ticket asked:
.sh,.toml,.html,.githooks/andNOTICEas well as.rs,.js,.mjsand.md. Deleted and renamed files count too, since a doc may name them.frontend/node_modules, as Prettier is, not throughnpx.One gap is left. Both tests read the working tree, as the suite does, not the index, so a file left out of a commit can pass here and fail on main.
frontend/test/pre-commit.test.jsruns the hook in a scratch repository. It was red before the hook changed.