Use square brackets for %w and %i array literals

This commit is contained in:
Sijawusz Pur Rahnama 2023-11-17 16:37:27 +01:00
parent 06dc201344
commit 10b577d23a
27 changed files with 101 additions and 99 deletions

View file

@ -44,7 +44,7 @@ module Ameba::Rule::Style
context "properties" do
it "#filter_names" do
rule = IsAFilter.new
rule.filter_names = %w(select)
rule.filter_names = %w[select]
expect_no_issues rule, <<-CRYSTAL
[1, 2, nil].reject(&.nil?)

View file

@ -4,7 +4,7 @@ module Ameba::Rule::Style
subject = ParenthesesAroundCondition.new
describe ParenthesesAroundCondition do
{% for keyword in %w(if unless while until) %}
{% for keyword in %w[if unless while until] %}
context "{{ keyword.id }}" do
it "reports if redundant parentheses are found" do
source = expect_issue subject, <<-CRYSTAL, keyword: {{ keyword }}