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

Alignment rules missing for rescue/ensure #2060

Closed
lumeet opened this issue Jul 23, 2015 · 3 comments
Closed

Alignment rules missing for rescue/ensure #2060

lumeet opened this issue Jul 23, 2015 · 3 comments

Comments

@lumeet
Copy link
Contributor

lumeet commented Jul 23, 2015

Currently there seems to be no cop to complain about the following.

begin
  a
      rescue
        b
            ensure
              c
end

And if we start with:

begin
a
rescue
b
ensure
c
end

...and auto-correct, Style/IndentationWidth (alone) makes it to look like this (by default):

begin
  a
  rescue
    b
  ensure
    c
end
@bbatsov
Copy link
Collaborator

bbatsov commented Jul 23, 2015

PRs welcome! :-)

@lumeet
Copy link
Contributor Author

lumeet commented Jul 23, 2015

Ok, I'll try to submit one soon as I happened to do some groundwork already. :) I guess it could be a new Lint cop that aligns the rescue and ensure keywords with the corresponding end without introducing any configs. EndAlignment and DefEndAlignment already do pretty good job to get that end aligned correctly. @bbatsov, @jonas054 Any comments at this point?

@bbatsov
Copy link
Collaborator

bbatsov commented Jul 23, 2015

Sounds like a plan to me. I've nothing further to add at this point.

bbatsov added a commit that referenced this issue Jul 24, 2015
[Fix #2060] New cop Style/RescueEnsureAlignment
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