Pattern: Redundant splat expansion
Issue: -
This rule checks for redundant usages of splat expansion.
# bad
a = *[1, 2, 3]
a = *'a'
a = *1
begin
foo
rescue *[StandardError, ApplicationError]
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end
# good
c = [1, 2, 3]
a = *c
a, b = *c
a, *b = *c
a = *1..10
a = ['a']
begin
foo
rescue StandardError, ApplicationError
bar
end
case foo
when *[1, 2, 3]
bar
else
baz
end