Skip to content

chore(lint): stop Biome walking into git worktrees - #320

Merged
antosubash merged 1 commit into
mainfrom
chore/biome-skip-worktrees
Sep 5, 2026
Merged

antosubash merged 1 commit into
mainfrom
chore/biome-skip-worktrees

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Found while verifying main's gates after today's merges. Not tied to an issue.

The problem

git worktree add .claude/worktrees/<name> is the workflow this repo already uses — there are 19 such worktrees on my checkout right now. Each one contains a copy of biome.json, and Biome 2.5 treats a nested config as a hard error:

/home/…/.claude/worktrees/admin-redesign/biome.json configuration ━━━━━━
  × Found a nested root configuration, but there's already a root configuration.

One per worktree, and npx biome ci . exits non-zero, so make lint fails outright for anyone with a branch checked out that way — regardless of whether their own code is clean.

CI never sees it: a fresh clone has no worktrees. So this is a local-only failure, and the error message points at biome migrate --write, which is the wrong remedy entirely.

The fix

One line. files.includes already scopes which files are checked; this scopes which directories are walked at all.

Two details that took a couple of attempts:

  • The pattern goes among the existing negations, not first — a leading ! entry makes Biome match nothing (lint/suspicious/noBiomeFirstException).
  • !.claude, not !.claude/** — since 2.2.0 the trailing /** on a folder exclusion is itself flagged (lint/suspicious/useBiomeIgnoreFolder).

Verification

Coverage is unchanged — I checked rather than assumed:

$ npx biome check host packages modules   # without the line
Checked 343 files
$ npx biome check host packages modules   # with the line
Checked 343 files

And the full run now succeeds with 19 worktrees present:

$ npx biome check .
Checked 344 files in 132ms. No fixes applied.

(344 = the same 343 plus biome.json itself, which the root run includes.)

`git worktree add .claude/worktrees/<name>` is the workflow this repo already
uses, and every worktree carries its own `biome.json`. Biome 2.5 treats a nested
config as an error — "Found a nested root configuration, but there's already a
root configuration" — one per worktree, so `make lint` fails outright for anyone
with a branch checked out that way. CI never sees it: a fresh clone has no
worktrees.

`files.includes` scopes which files are checked; this scopes which directories
are walked at all. Same 343 files checked before and after, verified by running
Biome over `host packages modules` with and without the line.

Placed among the existing negations rather than first: a leading `!` pattern
makes Biome match nothing, and `!.claude` without the `/**` suffix is the form
2.2+ wants.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-05T07:06:31.511681Z 7c63dad PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7c63dad
Status: ✅  Deploy successful!
Preview URL: https://9a7b8970.simple-module-python.pages.dev
Branch Preview URL: https://chore-biome-skip-worktrees.simple-module-python.pages.dev

View logs

@antosubash
antosubash merged commit ba195c9 into main Sep 5, 2026
13 checks passed
@antosubash
antosubash deleted the chore/biome-skip-worktrees branch September 5, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant