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

ForceEqualSignAlignment should only align block content #6069

Closed
egze opened this issue Jul 2, 2018 · 3 comments
Closed

ForceEqualSignAlignment should only align block content #6069

egze opened this issue Jul 2, 2018 · 3 comments
Labels
enhancement stale Issues that haven't been active in a while

Comments

@egze
Copy link
Contributor

egze commented Jul 2, 2018

The current alignment makes it not obvious what variables are set inside and outside the block. I think rubocop should align only what is inside the block.

Here is an example:

my_secret_values = [1,2,3,4].map do |i|
  x = i * 2
  secret = x*x
end

Expected behavior

my_secret_values = [1, 2, 3, 4].map do |i|
  x      = i * 2
  secret = x * x
end

Actual behavior

my_secret_values = [1, 2, 3, 4].map do |i|
  x              = i * 2
  secret         = x * x
end

Steps to reproduce the problem

Run rubocop with autocorrect.

RuboCop version

Include the output of rubocop -V. Here's an example:

$ rubocop -V
0.54.0 (using Parser 2.5.1.0, running on ruby 2.4.2 x86_64-darwin17)
@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label May 8, 2019
@stale
Copy link

stale bot commented Jun 7, 2019

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Jun 7, 2019
@jfelchner
Copy link
Contributor

This should be fixed in #7211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement stale Issues that haven't been active in a while
Projects
None yet
Development

No branches or pull requests

3 participants