-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Feature request: empty line after early return #5376
Labels
Comments
Yeah, that makes perfect sense to me. It's an extremely common style of coding, practiced by myself as well. |
I have had this on my list for a while, but I imagine an |
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Jan 30, 2018
Follow up of rubocop#5376 and rubocop#5522. The full fix is left to autocorrect after rubocop#5522 is implemented. This PR is updating template string and document which are not modified by autocorrect. Since the template becomes baseline of code, This PR changed it ahead of time.
unkmas
added a commit
to unkmas/rubocop
that referenced
this issue
Feb 27, 2018
unkmas
added a commit
to unkmas/rubocop
that referenced
this issue
Feb 27, 2018
unkmas
added a commit
to unkmas/rubocop
that referenced
this issue
Feb 27, 2018
bbatsov
pushed a commit
that referenced
this issue
Feb 28, 2018
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Aug 30, 2018
This PR enables `Layout/EmptyLineAfterGuardClause` cop by default. This cop has been introduced by rubocop#5522, with setting that is disabled by default. After that, I improved this cop by rubocop#5679, rubocop#5700, rubocop#5720, and rubocop#5760. I think that this cop can be enabled by default as the background of the issue rubocop#5376. And this PR applies auto-correction using this cop.
bbatsov
pushed a commit
that referenced
this issue
Aug 30, 2018
This PR enables `Layout/EmptyLineAfterGuardClause` cop by default. This cop has been introduced by #5522, with setting that is disabled by default. After that, I improved this cop by #5679, #5700, #5720, and #5760. I think that this cop can be enabled by default as the background of the issue #5376. And this PR applies auto-correction using this cop.
snh
added a commit
to github/pages-health-check
that referenced
this issue
Sep 20, 2018
Layout/EmptyLineAfterGuardClause: Add empty line after guard clause. rubocop/rubocop#5376
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice to have a cop that enforces consistent usage of empty lines after early returns.
Example:
Here the cop would require adding a blank line after the return.
Note: it's possible tho have multiple consecutive return statements with different conditions. In that case I would suggest adding the blank line after the last return.
The text was updated successfully, but these errors were encountered: