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: AlignWith: variable does not work with multiple assignment #709

Closed
sferik opened this issue Jan 1, 2014 · 1 comment
Closed
Assignees

Comments

@sferik
Copy link
Contributor

sferik commented Jan 1, 2014

I love the new AlignWith: variable configuration for the EndAlignment cop, added in #665 (and reported in #661), however this is one small issue with multiple assignment. I have created a reduced reproduction case:

x, y = if true
  [1, 2]
else
  [3, 4]
end

This program reports two offenses:

  1. EndAlignment: end at 5, 0 is not aligned with if at 1, 9
  2. IndentationWidth: Use 2 (not -7) spaces for indentation.

If the program is modified to single assignment, these offenses go away.

x = if true
  [1, 2]
else
  [3, 4]
end
@jonas054
Copy link
Collaborator

jonas054 commented Jan 1, 2014

I'm actually working on a fix for that problem already. Another situation where this configuration doesn't work is assignment to a class variable.

@@x = if true
  [1, 2]
else
  [3, 4]
end

@ghost ghost assigned jonas054 Jan 1, 2014
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

No branches or pull requests

2 participants