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

Broken autocorrect behaviour with EndAlignment AlignWith: variable. #2155

Closed
savef opened this issue Aug 18, 2015 · 3 comments
Closed

Broken autocorrect behaviour with EndAlignment AlignWith: variable. #2155

savef opened this issue Aug 18, 2015 · 3 comments
Assignees
Labels

Comments

@savef
Copy link
Contributor

savef commented Aug 18, 2015

I'm getting strange autocorrect behaviour with a file that looked like this:

Rails.application.config.ideal_postcodes_key =
  if Rails.env.production? || Rails.env.staging?
    "AAAA-AAAA-AAAA-AAAA"
  else
    "BBBB-BBBB-BBBB-BBBB"
  end

Rubocop thought it should be this:

Rails.application.config.ideal_postcodes_key =
  if Rails.env.production? || Rails.env.staging?
  "AAAA-AAAA-AAAA-AAAA"
else
  "BBBB-BBBB-BBBB-BBBB"
  end

This doesn't happen with a blank rubocop.yml, all you have to enable to cause it is:

Lint/EndAlignment:
  AlignWith: variable

Version (but I tried both the release and master on github and got the same behaviour):
0.33.0 (using Parser 2.2.2.6, running on ruby 2.2.2 x86_64-linux)

@savef savef changed the title Broken autocorrect behaviour with EndAlignment Alignwith: variable. Broken autocorrect behaviour with EndAlignment AlignWith: variable. Aug 18, 2015
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 22, 2015

@jonas054 would you take a look at this?

@bbatsov bbatsov added the bug label Aug 22, 2015
@jonas054
Copy link
Collaborator

Yes.

@savef
Copy link
Contributor Author

savef commented Aug 24, 2015

Thanks! 😄

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

3 participants