Add automated documentation link validation#4949
Open
Nokhrin wants to merge 1 commit into
Open
Conversation
Signed-off-by: Aleksandr Nokhrin <a.v.nokhrin@yandex.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR proposes adding automated documentation link validation to the ANTLR4 repository using
docs-validator, a Python-based static analyzer that detects broken links, orphan files, missing anchors, and circular dependencies in documentation repositories.Compliance with ANTLR contribution guidelines
✅ Branch: This PR is from
experiment/docs-validation-20260614, derived fromdev✅ DCO: All commits are signed with
git commit -s(Developer Certificate of Origin)✅ Scope: Only adds
.github/workflows/docs-validation.yml- no changes to source code or existing documentationExperiment Results
I ran
docs-validatoragainst the ANTLR4 documentation to demonstrate its value. The validation completed in ~35 seconds and analyzed 63 documentation files containing 294 links (95 internal, 196 external).Metrics
Real Issues Discovered
1. Broken Internal Links (1 error)
doc/ace-javascript-target.md:137→resources/worker-base.js(file not found)2. Broken External Links (25 errors)
README.md:13→https://github.com/antlr/antlr4/actions/workflows/windows.yml/badge.svg?branch=dev(workflow doesn't exist)doc/java-target.md:19→https://marketplace.eclipse.org/content/antlr-ide(404)doc/releasing-antlr.md:159,191,251→ Multipleoss.sonatype.orglinks (404)doc/resources.md:12→http://leonotepad.blogspot.com.br/...(404)doc/swift-target.md:5→ Apple Swift Package Manager docs (anchor not found)doc/target-agnostic-grammars.md:24→grammars-v4repository (anchor not found)3. Orphan Files (48 warnings)
Files without incoming links, potentially undiscoverable:
ANTLR-HOUSE-RULES.mddoc/ace-javascript-target.md,doc/actions.md,doc/cpp-target.md, etc.runtime/Cpp/cmake/Antlr4Package.mdruntime/Go/antlr/README.adoc4. Manual Verification Required (38 warnings)
Resources blocked by WAF or rate-limited:
pragprog.comlinks (403)npmjs.comlinks (403)oss.sonatype.orglinks (403)Benefits for ANTLR4
What This PR Adds
This PR adds a single file:
.github/workflows/docs-validation.ymlThe workflow:
devandmasterbranches.md,.markdown,.asc, or.adocfilesworkflow_dispatchConfiguration
The workflow uses default settings. If maintainers want to customize behavior, they can add a
.docs-validator.tomlfile to the repository root with options like:References
I'm happy to adjust the workflow configuration, add a
.docs-validator.tomlfile with project-specific exclusions, or make any other changes based on maintainer feedback.