sedona icon indicating copy to clipboard operation
sedona copied to clipboard

[CI] Add `lychee` link checker with `pre-commit`

Open jbampton opened this issue 1 year ago • 2 comments

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?

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

Screenshot from 2024-04-26 03-50-43

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.

jbampton avatar Apr 25 '24 18:04 jbampton

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.

jbampton avatar Apr 25 '24 18:04 jbampton