Skip to content

chore(#2177): add lint-docs-links check; fix all escaping docs/ links#2181

Open
rh-hemartin wants to merge 1 commit into
mainfrom
fix/2177-docs-link-scope
Open

chore(#2177): add lint-docs-links check; fix all escaping docs/ links#2181
rh-hemartin wants to merge 1 commit into
mainfrom
fix/2177-docs-link-scope

Conversation

@rh-hemartin

Copy link
Copy Markdown
Member

Summary

  • Adds hack/lint-docs-links, a pre-commit hook that rejects relative links in docs/ that resolve outside the docs/ tree
  • Wires the hook into .pre-commit-config.yaml (runs on all docs/**/*.md files)
  • Fixes all 53 pre-existing violations by converting escaping relative links to absolute github.com/fullsend-ai/fullsend/blob/main/… URLs

Links that escape docs/ are broken on fullsend.sh, which only serves the docs/ tree.

Closes #2177.

Test plan

  • make lint passes (lint-docs-links runs as part of pre-commit)
  • ./hack/lint-docs-links $(git ls-files docs/ | grep '\.md$') exits 0
  • Introducing a new escaping link in docs/ causes the hook to fail

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Site preview

Preview: https://9079eac1-site.fullsend-ai.workers.dev

Commit: 1c8577f9019104aefeaa2921375bcb27f5d85cd4

Adds hack/lint-docs-links, a pre-commit hook that rejects relative links
in docs/ that resolve outside the docs/ tree. Such links are broken on
fullsend.sh, which only serves docs/. The error output includes a
remediation hint pointing authors to use absolute GitHub URLs.

Fixes all 53 pre-existing violations by converting them to absolute
github.com/fullsend-ai/fullsend/blob/main/... URLs. Closes #2177.

Signed-off-by: Hector Martinez <hemartin@redhat.com>
@rh-hemartin rh-hemartin force-pushed the fix/2177-docs-link-scope branch from 6c07ab2 to 1c8577f Compare June 11, 2026 15:11
@rh-hemartin rh-hemartin changed the title lint: add lint-docs-links check; fix all escaping docs/ links chore(#2177): add lint-docs-links check; fix all escaping docs/ links Jun 11, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jun 11, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:13 PM UTC · Completed 3:21 PM UTC
Commit: 1c8577f · View workflow run →

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] .pre-commit-config.yaml — This PR modifies .pre-commit-config.yaml, which is a protected path requiring human approval. The change is well-justified (adds a new lint-docs-links hook per issue lint: reject docs/ links that resolve outside docs/ #2177), but human review is always required for protected-path changes regardless of context.

Low

  • [logic-error] hack/lint-docs-links:31 — The prefix check [[ "$resolved" != "$docs_dir"* ]] would also match paths under a hypothetical sibling directory starting with docs (e.g., docs-legacy/). Currently no such directory exists in the repo, making this theoretical.
    Remediation: Change to if [[ "$resolved" != "$docs_dir/"* ]] to require the trailing slash.

  • [edge-case] hack/lint-docs-links:33 — The link-extraction regex (?<=\])\(\K[^)]+ captures Markdown title attributes (e.g., [text](path "title")). The title text is not stripped before realpath -m, which would cause false positives on links with title attributes. Currently no docs files use this syntax, so the issue is latent.
    Remediation: Strip optional title after extraction: path="${path%% \"*}".

Info

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Jun 11, 2026

@ralphbean ralphbean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Link conversions all check out — correct paths, correct blob/tree usage, intra-docs links left alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lint: reject docs/ links that resolve outside docs/

2 participants