opensafely / documentation

Documentation for the OpenSAFELY platform
https://docs.opensafely.org
Other
35 stars 6 forks source link

Add automated link checks #642

Closed StevenMaude closed 2 years ago

StevenMaude commented 2 years ago

Looking around at other organisations using a "docs as code" approach, a link checker is a fairly standard piece of validation.

There may be other software around, but lychee looks like it could be a good contender. lychee's README also has a list of other competing software.

There may be occasionally private links that we have to skip over. These should be few in number.

StevenMaude commented 2 years ago

lychee report run on content as of 9a3863676387d0b71237e43e69fb03af3a3d375b

Summary

Status Count
🔍 Total 434
✅ Successful 409
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 0
❓ Unknown 0
🚫 Errors 25

Errors per input

Errors in docs/dataset-definition.md

Errors in overrides/main.html

Errors in docs/actions-pipelines.md

Errors in docs/study-def-variables.md

Errors in INSTALL.md

Errors in docs/dataset-ecds.md

Errors in docs/study-def-tricks.md

Errors in docs/dataset-cpns.md

Errors in docs/releasing-files.md

Errors in docs/protocol.md

Errors in docs/getting-started.md

Errors in docs/index.md

Errors in DEPLOY.md

Errors in docs/dataset-apc.md

Errors in docs/install-macos.md

Notes

Kinds of error

StevenMaude commented 2 years ago

This has found some genuinely broken links as listed in #709.

I think this approach is useful. The limitation, as mentioned at the outset, is that a small percentage (about 3%) of links would need periodic manual review.

It might also be one to use for other sites we maintain.

StevenMaude commented 2 years ago

Things to do if implementing:

StevenMaude commented 2 years ago

With an exclude file in my own fork, we're now at:

Status Count
🔍 Total 452
✅ Successful 419
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 33
❓ Unknown 0
🚫 Errors 0