ci: offline Markdown link and heading-anchor checker
Your AI's guard dog to stop it from going rogue.
Brought to you by:
doberman
Originally created by: AshSgDe29071999
scripts/check_markdown_links.py: offline checker for repository-local Markdown file links and #heading / HTML name/id anchors.README.md, CONTRIBUTING.md, SECURITY.md, other root *.md, docs/**/*.md).http(s):, mailto:, and other external schemes (no network).file:line: reason: target diagnostics and exit nonzero on failure..github/workflows/ci.yml.docs/SETUP.md so current docs pass the checker.pytest tests/unit/test_check_markdown_links.pypython scripts/check_markdown_links.py → ok on current docsruff check / ruff format on the new filesFixes [#175]
Originally posted by: fu351
First, thank you, and I'm sorry this one lands as a duplicate. You and @jasperdingg built the same checker in parallel, and [#175] was already assigned to them, so the plan is to land [#306] and close this one in its favor. That's an assignment call, not a quality one, and I want to be clear about that.
There's one thing your version does better that I don't want to lose: you check existence for any local target (images, assets, directories), not just
.mdfiles. [#306] deliberately skips those, so broken asset links slip past it — a real gap in the one we're landing. If you'd open a small follow-up to add asset-existence checking on top of [#306] once it's in, I'd take it happily and credit it to you.A couple of honest notes on this PR, since they're what tipped it: the curated
DEFAULT_GLOBSmisses 8 of the repo's 23 Markdown files today (a full-tree walk avoids that), reference-style[text][ref]links aren't parsed, and the diagnostics print backslash paths on the Windows CI leg. None of that takes away from the work — your anchor and fence handling were solid.Given how much you've shipped this week, a natural next piece: #192 — a shared JSON-output contract across the CLI's JSON commands. It builds straight on the
status --jsonwork in your [#315]. Want it? It's yours.Thanks again, and genuinely glad you're building here.
Related
Tickets:
#175Tickets:
#306Tickets:
#315Ticket changed by: fu351