From 32749eb665eea548b519b70d646e835a9634edb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Thu, 30 Jul 2026 02:41:43 +0000 Subject: [PATCH] document that bun format touches every dirty file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script globs `git diff --name-only HEAD`, so running it after a small change also reformatted an unrelated file the owner had in progress — whitespace churn landing in someone else's diff with no explanation. Point at `bunx prettier --write ` instead. Co-Authored-By: Claude Opus 4.8 --- CLAUDE.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 5438b43a..73323ea1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -111,13 +111,18 @@ bun dev # the whole app — SPA + API + WebSockets, watched bun start # production bunx tsgo # typecheck (not tsc) bun test # tests -bun format # prettier over changed files only +bun format # prettier over every dirty file — see the note below before running it bun db:push # apply the schema to Postgres bun setup # guided install (writes .env, incl. PUBLIC_BUILD_ENV=production) ``` Sidecar control: `bun run start:sidecar` / `stop:sidecar` / `restart:sidecar` / `logs:sidecar`. +**Format your own files, not the whole dirty tree.** `bun format` globs `git diff --name-only HEAD`, +so it rewrites every uncommitted file — including work in progress that isn't yours, which then shows +up as unexplained whitespace churn in someone else's diff. Run `bunx prettier --write ` on the +files you actually touched. `bun format` is only safe when the tree is otherwise clean. + Note: `build:editor*` in `package.json` points at `scripts/build/editor.ts`, which does not exist. ## Code Style