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

[Fix #6202] RescueEnsureAlignment auto-correct infinite loop #6246

Merged
merged 3 commits into from Sep 9, 2018

Conversation

rrosenblum
Copy link
Contributor

This fixes #6202. The code example will no longer register an offense.

def method1
  'foo'
end

def method2
  'bar'
rescue
  'baz' end

I modified the cop to use the beginning position, rather than the end position, to determine the alignment of rescue and ensure.

@rrosenblum rrosenblum changed the title [Fix #6202] Rescue ensure alignment [Fix #6202] RescueEnsureAlignment auto-correct infinite loop Sep 5, 2018
…ginning

position rather than the end position
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 this pull request may close these issues.

Infinite loop detected when run rubocop -a to some code with miss alignment 'end'
2 participants