[CI] Add `lychee` link checker with `pre-commit`
Clean up and improve the docs. Update the Makefile.
https://github.com/lycheeverse/lychee
"Fast, async, stream-based link checker written in Rust. Finds broken URLs and mail addresses inside Markdown, HTML, reStructuredText, websites and more!"
Did you read the Contributor Guide?
- Yes, I have read the Contributor Rules and Contributor Development Guide
Is this PR related to a JIRA ticket?
- No, this is a documentation update. The PR name follows the format
[DOCS] my subject.
What changes were proposed in this PR?
Updated our hooks with pre-commit autoupdate
Added the lychee link checker.
fixes #1360
lychee seems to be more advanced than markdown-link-check.
In future we can add pre-commit inside Docker to allow contributors to run the pre-commit tests with Docker.
Since link checker tests can sometimes make a lot of noise and fail, I have separated the link checker from the other pre-commit checks.
How was this patch tested?
Ran Makefile command:
make checklinks
Ran pre-commit ( no link checker):
make check
This is my current output from running lychee locally
We have two broken links.
Did this PR include necessary documentation updates?
- No, this PR does not affect any public API so no need to change the documentation.
After we fix the remaining broken links we can then choose going forwards to just check the links in modified files by running pre-commit run lychee or pre-commit run lychee --all-files to check all Markdown files with GitHub Actions.
The full check is taking 3 minutes so far.