New Rule to valdiate references to local files #704
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.
This Pull Request introduces a new plugin/rule that validates all local references. The plugin checks if the referenced file exists and also verifies that if the reference includes an anchor pointing to a scanned Markdown file, the corresponding heading exists as well. This ensures the integrity of the references and improves the overall quality of the documentation.
I have assigned the next available Rule Number for this plugin.
To validate anchors, the plugin scans both the Markdown file containing the reference and the Markdown file containing the heading. Currently, the report for each file is printed immediately after scanning it, resulting in an unsorted list of reports.
To address this, I propose printing all failure reports after scanning all the files. This approach will provide a consolidated and sorted view of the reports, making it easier to identify and address any issues in a more organized manner.
Reasoning
Ensuring Correctness
Invalid URLs for links and images can be a significant issue in documentation. Manually validating each link and image is a time-consuming task. With this rule, you can automatically validate the references to various parts of the documentation, such as links and images.
This helps to ensure the correctness and integrity of the documentation by identifying and flagging any invalid or broken references.