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

EndAlignment when assignment doesnt fit on line #327

Closed
lenntt opened this issue Jul 3, 2013 · 1 comment · Fixed by #331
Closed

EndAlignment when assignment doesnt fit on line #327

lenntt opened this issue Jul 3, 2013 · 1 comment · Fixed by #331

Comments

@lenntt
Copy link

lenntt commented Jul 3, 2013

i noticed having in my code:

some_variable = 
    a_long_method_that_didnt_fit_previous_line do
      do_something
    end

EndAlignment suggests this is wrong.
what would be the correct way to write it?

this? (i dont think it gets better this way):

some_variable = 
    a_long_method_that_didnt_fit_previous_line do
  do_something
end

edit: another one is when method chaining.
This is unaccepted by rubocop:

some_variables.map do |foo|
  foo.do_something
end.each do |bar|
  bar.do_something_else
end
@edzhelyov
Copy link
Collaborator

@SirLenz0rlot, the second case:

some_variables.map do |foo|
  foo.do_something
end.each do |bar|
  bar.do_something_else
end

passes for me, even when I ran it against the 0.9.0 branch.

We still don't handle the first case and return false offences, I'm working on fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants