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 #7795] Make Layout/EmptyLineAfterGuardClause aware of and return #7796

Commits on Mar 19, 2020

  1. [Fix rubocop#7795] Make Layout/EmptyLineAfterGuardClause aware of `…

    …and return`
    
    Resolves rubocop#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.
    koic committed Mar 19, 2020
    Configuration menu
    Copy the full SHA
    2e9f9e2 View commit details
    Browse the repository at this point in the history