Relax linting rules in HAML to allow for HTML entities

Adding an HTML entity such as   in haml files will trigger a NoPlainNodes error.

 ee/app/views/projects/environments/logs.html.haml:21 [W] NoPlainNodes: ` ` is a plain node. Please use an i18n method like `= _(' ')`

The related code is in the linter: https://gitlab.com/gitlab-org/gitlab/blob/master/haml_lint/linter/no_plain_nodes.rb

Reproduce this issue:

The following diff shows the problem:

!17532 (44710c2d)

Original note from an MR:

Note to reviewer/maintainer: Currently we have a rather strict linting rule, which assumes all plain text nodes should be translated. This small hack allows this MR to pass the linting.

Error was:

ee/app/views/projects/environments/logs.html.haml:12 [W] NoPlainNodes: ` ` is a plain node. Please use an i18n method like `= _(' ')`
ee/app/views/projects/environments/logs.html.haml:21 [W] NoPlainNodes: ` ` is a plain node. Please use an i18n method like `= _(' ')`

Original discussion:

The following discussion from !17532 (merged) should be addressed:

  • @wortschi started a discussion:

    I wonder if should investigate this in a follow-up issue? Maybe we can adjust our linting rules to be a bit less strict?

Edited Dec 02, 2019 by Miguel Rincon
Assignee Loading
Time tracking Loading