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/DocUrl which should be moved to the Gitlab/DocumentationLinks namespace so we can better group documentation links linters together. The proposal is to rename it to Gitlab/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 DocumentationLinks HAML linter in favor of Gitlab/DocumentationLinks/Link. Make sure Gitlab/DocumentationLinks/Link does cover the same cases as DocumentationLinks, 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/Link runs 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