Layout/RescueEnsureAlignment
crashes for block results assigned to setter methods on the same line
#12324
Labels
Layout/RescueEnsureAlignment
crashes for block results assigned to setter methods on the same line
#12324
The
Layout/RescueEnsureAlignment
cop fails with the following minimal reproduction:Running rubocop against this file results in:
An error occurred while Layout/RescueEnsureAlignment cop was inspecting [file]
.The error only occurs with a setter method. It doesn't fail if the block is assigned directly to a variable:
The error only occurs if the block is defined on the same line. This does not fail (with any variation of indentation):
The error occurs with any method being passed a block. I used
loop
here for a minimal example.And to be clear, the error does not appear with correctly indented code, even with these failure conditions. This passes with no error:
Expected behavior
No exception raised
Actual behavior
Console output from `bundle exec rubocop -d`
Steps to reproduce the problem
Save the minimal reproduction file in a directory containing a
Gemfile
with the following contents:and a
.rubocop.yml
file with the following contentsRun
bundle install
followed bybundle exec rubocop
RuboCop version
The text was updated successfully, but these errors were encountered: