From 94967d22fe2c91a8f2f2054e0882d54da26a58ea Mon Sep 17 00:00:00 2001 From: mrsibe Date: Fri, 25 Sep 2026 19:54:33 +0800 Subject: [PATCH] chore(format): stop prettier rewriting the generated eval baseline The committed `docs/eval/baseline-v1.4.json` is the eval harness output verbatim - `src/main/eval/run.ts` writes it with `JSON.stringify(report, null, 2)` - and that is deliberately *not* prettier's formatting: prettier collapses the short `matchesByRank` arrays onto one line, which turns a 12 KB file into an 8 KB one without changing a value. So prettier was a second writer for a generated file. `npm run format` (and any editor running prettier on save in that directory) reformatted both files and left a dirty worktree behind, which is where the recurring uncommitted `docs/eval` noise came from: a diff of ~450 lines that said nothing, and which had to be manually excluded from every unrelated PR. Both files are now ignored, since regenerating them is a documented command (`npm run eval`, which rewrites `docs/eval/`) and the baseline's value is that it is byte-comparable to what the harness produces. `docs/eval/baseline-*` is ignored rather than the directory, so a hand-written document that later lands in `docs/eval/` is still formatted. Verified: `npx prettier --check .` reports no issues repo-wide, and with the ignore bypassed (`--ignore-path /dev/null`) prettier still flags `baseline-v1.4.json` - so the churn stops because the generated file is left alone, not because it was reformatted once. --- .prettierignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.prettierignore b/.prettierignore index 43d52eb..bb7d473 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,3 +5,11 @@ LICENSE.md tsconfig.json tsconfig.*.json src/main/db/migrations/meta + +# Generated, not hand-written. `scripts/eval.mjs` (via src/main/eval/run.ts) writes +# both of these, and the committed copy is that output verbatim, so the formatter +# must not be a second writer: `npm run format` reformatted them into a diff that +# said nothing and left a dirty tree behind every time. Regenerate with +# `npm run eval`; the baseline's readability is not the formatter's business. +docs/eval/baseline-*.json +docs/eval/baseline-*.md