Skip to content

chore: keep prettier out of the per-session worktrees - #155

Merged
ajbarea merged 1 commit into
mainfrom
fix/prettier-ignore-worktrees
Sep 22, 2026
Merged

ajbarea merged 1 commit into
mainfrom
fix/prettier-ignore-worktrees

Conversation

@ajbarea

@ajbarea ajbarea commented Sep 22, 2026

Copy link
Copy Markdown
Owner

npm run format:check fails from inside a git worktree, on files that are deliberately exempt on main.

A worktree under .claude/worktrees/ holds a second copy of the whole tree, so prettier walks every path a second time under a prefix that no existing rule matches. .prettierignore exempts src/content/ because the issue-form intake and Sveltia CMS emit their own frontmatter style — but that pattern does not cover .claude/worktrees/<name>/src/content/, so the same CMS content comes back as a violation:

[warn] .claude/worktrees/org-switch/src/content/people/sergei-chuprov.md

CI never sees this: there is no .claude/worktrees/ on a runner, which is why format:check is green on every PR. It only costs whoever is running the worktree workflow locally, where it reads as a real failure on a file they did not touch.

Scoped to .claude/worktrees/ rather than .claude/, because .claude/skill-context.md is tracked and should stay formatted.

Verification

  • npm run format:check exits 0 in a checkout that has a worktree present; before, exit 1.
  • The ignore is not too broad: breaking the formatting of .claude/skill-context.md still fails format:check, so the tracked file remains covered.

A worktree under .claude/worktrees/ holds a second copy of the whole tree,
so prettier reads every path again under a prefix no rule below matches:
`src/content/` does not cover `.claude/worktrees/<name>/src/content/`. CMS
content that is deliberately exempt on main therefore reddened
`format:check` from inside a worktree.

Absent in CI, so this only ever affected someone running the worktree
workflow locally. Scoped to the worktrees path rather than `.claude/`, so
the tracked skill-context.md stays covered -- checked by breaking its
formatting and confirming format:check still fails on it.
@ajbarea ajbarea added the documentation Improvements or additions to documentation label Sep 22, 2026
@ajbarea ajbarea self-assigned this Sep 22, 2026
@ajbarea
ajbarea enabled auto-merge (squash) September 22, 2026 11:47
@ajbarea
ajbarea merged commit bf11503 into main Sep 22, 2026
11 checks passed
@ajbarea
ajbarea deleted the fix/prettier-ignore-worktrees branch September 22, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant