diff options
| author | Luke Bennett <lbennett@gitlab.com> | 2019-04-13 23:14:27 +0100 |
|---|---|---|
| committer | Luke Bennett <lbennett@gitlab.com> | 2019-04-13 23:14:27 +0100 |
| commit | 95f522a159800997ee94b0f98c9fdefe78572140 (patch) | |
| tree | 6ee2b1544926fdada94c594fb99a4e03e3584818 /unwrapped_plain_node.rb | |
| parent | 44be329d59bc20598c2c2f310d4f3029c8dd25a9 (diff) | |
| download | gitlab-ce-haml_lint_plain_node.tar.gz | |
beep boophaml_lint_plain_node
Diffstat (limited to 'unwrapped_plain_node.rb')
| -rw-r--r-- | unwrapped_plain_node.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/unwrapped_plain_node.rb b/unwrapped_plain_node.rb new file mode 100644 index 00000000000..9525e830304 --- /dev/null +++ b/unwrapped_plain_node.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module HamlLint + # Checks for unwrapped text nodes. + # Useful for i18n helper methods. + # + # Fail: %tag Some text + # Pass: %tag= _('Some text') + class Linter::UnwrappedPlainNode < Linter + include LinterRegistry + + MESSAGE = '`= "..."` should be rewritten as `...`'.freeze + + def visit_plain(node) + record_lint(node, MESSAGE) + end + end +end |
