Skip to content

chore: exclude git worktrees from tooling#4286

Merged
erickzhao merged 1 commit into
nextfrom
chore/ignore-worktrees-in-ci-tooling
Jun 9, 2026
Merged

chore: exclude git worktrees from tooling#4286
erickzhao merged 1 commit into
nextfrom
chore/ignore-worktrees-in-ci-tooling

Conversation

@erickzhao

@erickzhao erickzhao commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Enables using git worktrees in this repo without breaking things in the root repository. Worktrees created under .claude/worktrees/ are full nested checkouts, and several CI tools recursed into them.

I built a fake worktree under .claude/worktrees/ and ran each CI tool against it to determine which actually descend in (rather than inferring from glob rules). Three tools needed exclusions:

Tool Problem
vitest include: ['**/spec/**/*.spec.ts'] matched specs inside the worktree → every spec runs twice, with potential fixture-path collisions
oxlint .claude not in ignorePatterns → lints duplicate source
oxfmt .claude not in ignorePatterns → format-checks duplicate source

Each now excludes **/.claude/**.

Already safe (verified, no change needed)

markdownlint-cli2 + lint-roller (their **/*.md globs don't descend into dot-directories), knip (scoped to package.json workspaces), build tooling (getPackageInfo only reads packages/), the CI artifact upload (packages/*/*/dist/*), and git status (git auto-excludes registered worktrees).

Notes

  • A bare .claude entry does not work for oxlint/oxfmt — unlike node_modules, a hidden directory needs an explicit glob (**/.claude/**). Verified the glob form works.
  • Nothing under .claude is tracked in git, so excluding it wholesale is safe.
  • Scope: covers worktrees under .claude/worktrees/. Worktrees placed elsewhere in the tree would need their own exclusions.

Test plan

  • Built a probe worktree under .claude/worktrees/ and confirmed vitest/oxlint/oxfmt each picked up the duplicate files before the fix
  • Confirmed all three exclude the probe after the fix
  • Confirmed a normal run (no worktree present) is unaffected (oxlint still lints all 255 files)
  • Configs remain valid JSON

🤖 Generated with Claude Code

Worktrees created under `.claude/worktrees/` are full nested checkouts.
vitest, oxlint, and oxfmt all recursed into them, causing specs to run
twice (with potential fixture path collisions) and duplicate source to be
linted/format-checked.

Add `**/.claude/**` exclusions to vitest, oxlint, and oxfmt configs. Other
tooling (markdownlint, lint-roller, knip, build scripts, the CI artifact
upload, and `git status`) already ignore the worktree path and needed no
change.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@erickzhao erickzhao requested a review from a team as a code owner June 9, 2026 20:33
@github-actions github-actions Bot added the next label Jun 9, 2026
@erickzhao erickzhao changed the title chore: exclude git worktrees from CI tooling chore: exclude git worktrees from tooling Jun 9, 2026
@erickzhao erickzhao enabled auto-merge (squash) June 9, 2026 20:37
@erickzhao erickzhao merged commit 8035d96 into next Jun 9, 2026
16 checks passed
@erickzhao erickzhao deleted the chore/ignore-worktrees-in-ci-tooling branch June 9, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants