Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross-file anchor link check (use lychee for markdown link checking) #614

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include-fragments = true

exclude = [
# excluding links to pull requests and issues is done for performance
"^https://github.com/open-telemetry/opentelemetry-proto/(pull|issue)/\\d+$"
]

# better to be safe and avoid failures
max-retries = 6
22 changes: 0 additions & 22 deletions .markdown_link_check_config.json

This file was deleted.

12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -p

.PHONY: markdown-link-check
markdown-link-check:
@if ! npm ls markdown-link-check; then npm install; fi
@for f in $(ALL_DOCS); do \
npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json $$f \
|| exit 1; \
done
docker run --rm \
--mount 'type=bind,source=$(PWD),target=/home/repo' \
lycheeverse/lychee \
--config home/repo/.lychee.toml \
--root-dir /home/repo \
-v \
home/repo

.PHONY: markdownlint
markdownlint:
Expand Down
Loading