Skip to content

Commit 3214055

Browse files
committed
merge: fix docs check worktree scope
2 parents ddfeb09 + 95b3359 commit 3214055

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

scripts/check_docs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def check_repository(root: Path) -> list[str]:
3131
errors: list[str] = []
3232
for markdown_file in sorted(root.rglob("*.md")):
3333
relative_file = markdown_file.relative_to(root)
34+
if {".git", ".worktrees", "worktrees"}.intersection(relative_file.parts):
35+
continue
3436
if relative_file.parts[:2] == ("docs", "superpowers"):
3537
continue
3638
try:

tests/test_docs_integrity.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ def test_check_repository_ignores_development_archive(tmp_path: Path) -> None:
5252
)
5353

5454
assert check_repository(tmp_path) == []
55+
56+
57+
def test_check_repository_ignores_linked_worktrees(tmp_path: Path) -> None:
58+
linked_worktree = tmp_path / ".worktrees" / "other-checkout"
59+
linked_worktree.mkdir(parents=True)
60+
(linked_worktree / "README.md").write_text(
61+
"[Historical link](docs/no-longer-current.md)\n",
62+
encoding="utf-8",
63+
)
64+
65+
assert check_repository(tmp_path) == []

0 commit comments

Comments
 (0)