Skip to content

在 .claude/worktrees/ 下的 worktree 里 pnpm lint 检查 0 个文件(#439 修复的反向失效) #444

Description

@ceilf6

现象

.claude/worktrees/<name>/ 里跑 pnpm lintbiome check .)会 0 文件退出并报错:

Checked 0 files in 10ms. No fixes applied.
  × No files were processed in the specified paths.
  i These paths were provided but ignored:
  - .

也就是说门禁没有跑,而不是跑通了——但退出码非 0,pre-commit / pre-push 因此在 worktree 里完全不可用。这正是 #439 想解决的那类故障,只是方向反了。

根因

#439 的修复(PR #442)往 biome.jsonfiles.includes 里加了 "!!**/.claude/worktrees"**/ 前缀让这条模式可以匹配路径中任意位置.claude/worktrees 片段。

当 biome 的 project root 本身就在 .claude/worktrees/ 下时,遍历根的绝对路径(/…/FrontAgent/.claude/worktrees/<name>)自身就命中这条硬排除,于是整棵树被忽略。

实测(biome 2.4.16):遍历根是 project root 时按绝对路径匹配,显式子路径按相对路径匹配——所以 biome check scripts 正常,biome check . 全被忽略。

建议修复

把模式改成锚定到 project root 的 "!!.claude/worktrees"(去掉 **/)。该目录只可能出现在仓库根,不需要 **/ 的任意深度语义。

实测两个方向都成立:

  • 根检出、.claude/worktrees/<x>/biome.json 在位时:仍然被排除,biome check . 不再因嵌套配置中止(去掉这条排除即复现 configuration 报错,可证伪);
  • worktree 内部:biome check . 正常检查 422 个文件。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions