From 977d5e635eb667d69c111eb0755971b020e91810 Mon Sep 17 00:00:00 2001 From: Stephane Segning Lambou Date: Fri, 29 May 2026 03:30:23 +0200 Subject: [PATCH] fix(ci): make biome lint/format robust to the .claude worktree path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `biome.json` excludes `**/.claude`. Claude Code worktrees live under `.claude/worktrees//`, so a bare `biome … .` run from a worktree self-excludes (the `.` arg resolves to a path under `.claude`) and silently processes ZERO files, exiting 0. That's exactly how an unformatted fixture sailed past local `pnpm format:check` and only blew up in CI (which runs from a normal checkout). Fix: the root lint / format / format:check scripts now pass explicit paths (`packages test-env *.json`) instead of `.`. Biome evaluates its `includes` patterns relative to biome.json, so those relative paths never match the `.claude` exclusion — the scripts process the same 62 files whether run from a worktree or the main checkout. Verified from a worktree: - `pnpm lint` → Checked 62 files, pass (was: 0 files) - `pnpm format:check` → Checked 62 files, pass (was: 0 files) - negative test: a stray blank line in a fixture now makes `pnpm format:check` exit 1 (previously exit 0). CLAUDE.md gotcha note updated to document the explicit-paths convention. Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 2 +- package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index fd31243..29dde1f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -110,7 +110,7 @@ When changing the mapping in [`packages/opencode-models-info/src/mapping.ts`](pa - **Default shell is zsh** on this laptop. `bash -c` scripts in tooling should stay POSIX-portable or be invoked under zsh explicitly. - **`gh` auth** lives in the interactive zsh profile. If `gh` looks unauthenticated under a plain non-interactive shell, retry under `zsh -i -c '…'` — `GITHUB_TOKEN` is loaded from `.zshrc`. -- **Biome ignores `**/.claude`** in `biome.json`. The Claude Code worktree path lives under `.claude/worktrees//`, which means running `pnpm lint` from a worktree silently lints zero files. Lint per-package (`pnpm --filter exec biome lint .`) from a worktree, or run the workspace lint from the main checkout. +- **Biome and the `.claude` worktree path.** `biome.json` excludes `**/.claude`, and Claude Code worktrees live under `.claude/worktrees//`. A bare `biome … .` therefore self-excludes (the `.` arg resolves under `.claude`) and silently processes **zero** files. To avoid that trap, the root `lint` / `format` / `format:check` scripts pass **explicit paths** (`packages test-env *.json`) instead of `.` — Biome evaluates `includes` relative to `biome.json`, so those relative paths never hit the `.claude` exclusion and the scripts work identically from a worktree or the main checkout. If you add a new top-level lintable directory, add it to those three scripts (otherwise it won't be checked). ## Design docs and plans diff --git a/package.json b/package.json index 5e5fb5d..eebcd5f 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,15 @@ "packageManager": "pnpm@11.3.0", "scripts": { "build": "pnpm -r build", - "lint": "biome lint .", + "lint": "biome lint packages test-env *.json", "typecheck": "pnpm -r typecheck", "test": "pnpm -r test", "test:env:up": "docker compose -f test-env/docker-compose.yml up -d --wait", "test:env:down": "docker compose -f test-env/docker-compose.yml down -v", "test:integration:run": "INTEGRATION_MODELS_INFO_URL=${INTEGRATION_MODELS_INFO_URL:-http://127.0.0.1:18080/v1/models} pnpm -r --if-present test:integration", "test:integration": "pnpm test:env:up && (pnpm test:integration:run; status=$?; pnpm test:env:down; exit $status)", - "format": "biome format --write .", - "format:check": "biome format ." + "format": "biome format --write packages test-env *.json", + "format:check": "biome format packages test-env *.json" }, "devDependencies": { "@biomejs/biome": "2.4.15",