Skip to content

Expand doc link check to .github/*.md - #75

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/check-local-links-github-dir
Jul 27, 2026
Merged

Expand doc link check to .github/*.md#75
dmccoystephenson merged 1 commit into
mainfrom
fix/check-local-links-github-dir

Conversation

@dmccoystephenson

@dmccoystephenson dmccoystephenson commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • check_local_links() only globbed REPO_ROOT.glob("*.md") -- top-level files only -- so .github/PULL_REQUEST_TEMPLATE.md and the three .github/ISSUE_TEMPLATE/*.md files were never checked for broken relative links. Currently none of them have links, so this was a silent coverage gap rather than an active bug, but a future edit adding one would pass CI unchecked.
  • Switched to REPO_ROOT.rglob("*.md") (skipping .git/) to cover the whole repo.
  • While there: fixed link resolution to be relative to the linking file's own directory (doc.parent) rather than always REPO_ROOT. This matches how GitHub actually renders relative markdown links and only matters once non-root-level docs are in scope -- for the existing top-level docs, doc.parent == REPO_ROOT, so behavior is unchanged there.
  • Verified detection by temporarily appending a broken link to PULL_REQUEST_TEMPLATE.md locally, confirming the script now fails on it, then reverting.

Research grounding

Tooling/CI-script change, not the template or a phase definition -- no RESEARCH.md finding applies.

Test plan

  • python3 scripts/check_docs.py passes on the current tree
  • Manually confirmed it now catches a broken link planted in .github/PULL_REQUEST_TEMPLATE.md (reverted before commit)
  • No {{placeholder}} or Step changes

drafted by Claude on behalf of Daniel Stephenson

check_local_links() only globbed top-level *.md, silently skipping
.github/PULL_REQUEST_TEMPLATE.md and the issue templates -- a
relative link added there would never be checked. Also resolve links
relative to the linking file's own directory rather than repo root,
matching how GitHub actually renders relative markdown links.
@dmccoystephenson
dmccoystephenson merged commit 70e0e9d into main Jul 27, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the fix/check-local-links-github-dir branch July 27, 2026 02:14
dmccoystephenson added a commit that referenced this pull request Aug 3, 2026
check_local_links() only globbed top-level *.md, silently skipping
.github/PULL_REQUEST_TEMPLATE.md and the issue templates -- a
relative link added there would never be checked. Also resolve links
relative to the linking file's own directory rather than repo root,
matching how GitHub actually renders relative markdown links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant