Skip to content

Use help_page_url in HAML to resolve Gitlab/DocUrl cop rule

Junichi Sato requested to merge sato11/gitlab:correct-doc-url-put-in-haml into master

What does this MR do and why?

This is the first step to close #388561 (closed).

This MR attempts to replace documentation urls embedded as string literal in haml files with the use of help_page_url, as the docs recommends: https://docs.gitlab.com/ee/development/documentation/#linking-to-help-in-ruby. !108558 (merged) separately is going to flag these cases as violation.

Changes are made manually as haml-lint does not support auto correction, unfortunately. Feel free to let me know if there should be a more elegant manner 🙇

Please note that commits are made incrementally with intention to highlight types of violation. If you want me to squash them in the first place though, let me know as well.

How to set up and validate locally

I wonder how in-depth I should have validated. I think I'm hoping there is already a systematic inspection that ensures these diffs as they appear are alright (haml-lint guarantees no obvious syntaxerror nor broken links, for example), without actually visiting every path? I'll be happy to be instructed 😖

As of these two snippets from the diff, because they seemed to be more delicate than the others, I have tried in console that they construct proper strings:

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Junichi Sato

Merge request reports