Follow-up from creating the `Gitlab/DocumentationLinks/Link` cop
In !165516 (merged), we introduced the Gitlab/DocumentationLinks/Link and had a few ideas to consolidate our linting tasks around documentation links:
-
There exists a Gitlab/DocUrlwhich should be moved to theGitlab/DocumentationLinksnamespace so we can better group documentation links linters together. The proposal is to rename it toGitlab/DocumentationLinks/HardcodedUrl(!165516 (comment 2098165420)). -
Let the cop register as many offences as it can detect on a single occurrence. Currently, the linter stops at the first detected offence. The DX would be improved if we raised all offences at once. We should also avoid side-effects where we register offences from within ?methods (!165516 (comment 2145869788)). -
Remove superfluous ===operator (!165516 (comment 2164007845)). -
Remove the DocumentationLinksHAML linter in favor ofGitlab/DocumentationLinks/Link. Make sureGitlab/DocumentationLinks/Linkdoes cover the same cases asDocumentationLinks, and that it is linting HAML files which was initially disabled so as to not overlap with the existing linter (!165516 (comment 2098093026)). -
Ensure Gitlab/DocumentationLinks/Linkruns in docs-only pipelines so that we can catch broken links when docs get updated or moved around (!165516 (comment 2098119618)). Addressed by @marcel.amirault in !169734 (merged). -
Address remaining ignored offences ( .rubocop_todo/gitlab/documentation_links/link.yml).
Potential follow-ups on the follow-up
- Take redirects into account to not warn about outdated links that are redirected to a valid one: !165516 (comment 2098119792). We should probably update those links anyways and not rely on the redirects, so this might not be worth the effort.
/cc @splattael
Edited by Paul Gascou-Vaillancourt