You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following line render(:partial) and return (if/unless condition) it would be nice to have a cop to enforce an empty line, the same way we have with: return .... if
The text was updated successfully, but these errors were encountered:
Perhaps it can be generalized to do_something(...) and return if condition.
I think this can be suggested to RuboCop core as an extension to Layout/EmptyLineAfterGuardClause cop.
koic
transferred this issue from rubocop/rubocop-rails
Mar 12, 2020
…and return`
Resolvesrubocop#7795.
This PR makes `Layout/EmptyLineAfterGuardClause` aware of `and return`.
It was proposed based on the following code controlled by Rails
controller.
```ruby
render :foo and return if condition
do_something
```
I think that it can be generalized as a control flow.
```ruby
foo(arg) and return if condition
do_something
```
So it will be newly detected by `Layout/EmptyLineAfterGuardClause` cop.
In the following line
render(:partial) and return (if/unless condition)
it would be nice to have a cop to enforce an empty line, the same way we have with:return .... if
The text was updated successfully, but these errors were encountered: