Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Lint/BlockAlignment suggest wrong `end` alignment #1219

Closed
ojab opened this Issue Jul 21, 2014 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

ojab commented Jul 21, 2014

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)

Collaborator

jonas054 commented Jul 22, 2014

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 Jul 22, 2014

@jonas054 jonas054 self-assigned this Jul 22, 2014

@jonas054 jonas054 closed this in ea0278e Jul 22, 2014

bbatsov added a commit that referenced this issue Jul 22, 2014

Merge pull request #1221 from jonas054/1219_block_end_align
[Fix #1219] Avoid reporting }/end sharing line with something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment