Class: HamlLint::Linter::MultilinePipe
Overview
Checks for uses of the multiline pipe character.
Constant Summary
collapse
- MESSAGE =
"Don't use the `|` character to split up lines. " \
'Wrap on commas or extract code into helper.'.freeze
Instance Attribute Summary
#lints
Instance Method Summary
collapse
extract_linters_from, included
#initialize, #name, #run
#visit, #visit_children
Instance Method Details
#visit_plain(node) ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/haml_lint/linter/multiline_pipe.rb', line 23
def visit_plain(node)
line = line_text_for_node(node)
return if line.strip == '|'
record_lint(node, MESSAGE) if line.match(MULTILINE_PIPE_REGEX)
end
|
#visit_script(node) ⇒ Object
15
16
17
|
# File 'lib/haml_lint/linter/multiline_pipe.rb', line 15
def visit_script(node)
check(node)
end
|
#visit_silent_script(node) ⇒ Object
19
20
21
|
# File 'lib/haml_lint/linter/multiline_pipe.rb', line 19
def visit_silent_script(node)
check(node)
end
|
#visit_tag(node) ⇒ Object
11
12
13
|
# File 'lib/haml_lint/linter/multiline_pipe.rb', line 11
def visit_tag(node)
check(node)
end
|