Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

Lint/BlockAlignment suggest wrong end alignment #1219

ojab opened this issue Jul 21, 2014 · 1 comment
Assignees
Labels

Comments

@ojab
Copy link
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)

@jonas054
Copy link
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 Jul 22, 2014
@jonas054 jonas054 self-assigned this Jul 22, 2014
bbatsov added a commit that referenced this issue Jul 22, 2014
[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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants