Skip to content

Commit 3e7e57a

Browse files
committed
RuboCop: Enable Style/WordArray and Style/SymbolArray with EnforcedStyle: brackets
1 parent 4d8a46a commit 3e7e57a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.rubocop.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ Style/StringLiteralsInInterpolation:
2929
EnforcedStyle: double_quotes
3030

3131
Style/WordArray:
32-
Enabled: false
32+
Enabled: true
33+
EnforcedStyle: brackets
3334

3435
Style/SymbolArray:
35-
Enabled: false
36+
Enabled: true
37+
EnforcedStyle: brackets
3638

3739
Style/BlockDelimiters:
3840
Enabled: false

lib/herb/engine/compiler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def visit_html_element_node(node)
7171
visit_all(node.body)
7272
visit(node.close_tag)
7373

74-
pop_context if %w[script style].include?(tag_name)
74+
pop_context if ["script", "style"].include?(tag_name)
7575

7676
@element_stack.pop if tag_name
7777
end
@@ -91,7 +91,7 @@ def visit_html_conditional_element_node(node)
9191
visit_all(node.body)
9292
visit(node.close_conditional)
9393

94-
pop_context if %w[script style].include?(tag_name)
94+
pop_context if ["script", "style"].include?(tag_name)
9595

9696
@element_stack.pop if tag_name
9797
end

lib/herb/engine/validators/nesting_validator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def validate_html_nesting(node)
3131
end
3232

3333
def validate_no_block_elements_in_paragraph(node)
34-
block_elements = %w[div section article header footer nav aside p h1 h2 h3 h4 h5 h6 ul ol dl table form]
34+
block_elements = ["div", "section", "article", "header", "footer", "nav", "aside", "p", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "dl", "table", "form"]
3535

3636
node.body.each do |child|
3737
next unless child.is_a?(Herb::AST::HTMLElementNode)
@@ -58,7 +58,7 @@ def validate_no_nested_anchors(node)
5858
end
5959

6060
def validate_no_interactive_in_button(node)
61-
interactive_elements = %w[a button input select textarea]
61+
interactive_elements = ["a", "button", "input", "select", "textarea"]
6262

6363
node.body.each do |child|
6464
next unless child.is_a?(Herb::AST::HTMLElementNode)

0 commit comments

Comments
 (0)