Skip to content

Commit 3b14a7e

Browse files
copeusclaude
andcommitted
fix(lint): skip worktrees — the phantom the gitignore fix could not reach
The linter walks the filesystem with rglob, not git, so ignoring .claude/worktrees/ did nothing for it: a local run during a parallel build still reported 68 issues, every one inside a sibling agent's checkout and none in this repository. Those checkouts are copies of this repo, so linting them double-reports every file even when nothing is wrong. Verified rather than assumed: clean before and after, --selftest green, and a planted frontmatter violation in agents/ is still reported (2 issues) and disappears when removed. A guard that has not been seen to fail is not known to work, and that applies to a guard I just narrowed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 666627a commit 3b14a7e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/lint-frontmatter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ def main(argv: list) -> int:
248248
total = 0
249249
for f in sorted(root.rglob("*.md")):
250250
parts = f.parts
251-
if "node_modules" in parts or ".git" in parts:
251+
# `worktrees` covers the harness's agent checkouts under .claude/worktrees/.
252+
# They are copies of THIS repo, so linting them double-reports every file
253+
# and, during a parallel build, reports dozens of "issues" in files that are
254+
# not in this checkout at all (observed at 51 and twice at 68). .gitignore
255+
# cannot help here: this walk is rglob, not git.
256+
if "node_modules" in parts or ".git" in parts or "worktrees" in parts:
252257
continue
253258
issues = lint_file(f, rel=f.relative_to(root))
254259
for i in issues:

0 commit comments

Comments
 (0)