Closed
Description
The minimal reproducing code:
if true
data[:foo] = {x:}
end
Run Rubocop with
rubocop test.rb --only Style/IfUnlessModifier -A
Expected behavior
The code is changed to:
data[:foo] = {x:} if true
Actual behavior
The code is changed to:
data[:foo](:foo, {x:}) if true
Doesn’t reproduce if without value-omission hashes (e.g., {x: 1}
)
RuboCop version
$ rubocop -V
1.70.0 (using Parser 3.3.7.0, rubocop-ast 1.37.0, analyzing as Ruby 3.1, running on ruby 3.2.2) [x86_64-linux]