Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Lint/BlockAlignment suggest wrong `end` alignment #1219

Closed
ojab opened this Issue · 1 comment

2 participants

@ojab

Testcase:

class Foo
  scope :bar, lambda { joins(:baz)
                       .distinct }
end

produces

/tmp/1.rb:3:34: W: Lint/BlockAlignment: end at 3, 33 is not aligned with lambda { joins(:baz) at 2, 14 or scope :bar, lambda { joins(:baz) at 2, 2
                       .distinct }
                                 ^

warning using 0.24.1 (using Parser 2.2.0.pre.3, running on ruby 2.1.2 x86_64-darwin14.0)

@jonas054
Collaborator

Yes, that's a bug. It should not check the alignment if the } or end doesn't begin the line it's on. I'll fix it.

@jonas054 jonas054 added the bug label
@jonas054 jonas054 self-assigned this
@jonas054 jonas054 closed this issue from a commit
@jonas054 jonas054 [Fix #1219] Avoid reporting }/end sharing line with something
For block ends that follow something else on the same line,
there's no correct or incorrect alignment.
ea0278e
@jonas054 jonas054 closed this in ea0278e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.