You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspecting 1 file
W
Offenses:
file.rb:3:3: W: [Corrected] Layout/EndAlignment: end at 4, 2 is not aligned with var = at 2, 0.
end
^^^
1 file inspected, 1 offense detected, 1 offense corrected
There are two problems with this.
var = is not at the start of the line where if is, so end should not be aligned with it.
It says [Corrected] but no correction is made.
Steps to reproduce the problem
Run rubocop -a in a directory with file.rb and .rubocop.yml as described.
Correctly handle code like
var =
if test
do_something
end
We do keyword alignment regadless of style, because aligning with the
variable:
var =
if test
do_something
end
doesn't look good when there's a line break.
Here's a problem I found. I've made a fix myself. A PR will be submitted soon.
Expected behavior
No offense reported for the file.
Actual behavior
With the configuration
and the file
the command
reports
There are two problems with this.
var =
is not at the start of the line whereif
is, soend
should not be aligned with it.[Corrected]
but no correction is made.Steps to reproduce the problem
Run
rubocop -a
in a directory withfile.rb
and.rubocop.yml
as described.RuboCop version
The text was updated successfully, but these errors were encountered: