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 edge case in omit_parentheses style of Style/MethodCallWithArgsParentheses #7639

Merged
merged 1 commit into from Jan 10, 2020

Commits on Jan 9, 2020

  1. Fix an edge case in omit_parentheses style of `Style/MethodCallWith…

    …ArgsParentheses`
    
    Before this change:
    
    ```ruby
    foo(a) || bar(b) do
                 ^^^ Omit parentheses for method calls with arguments.
      pass
    end
    ```
    
    This resulted in a `SyntaxError`, if corrected. The check for a call
    with logical operator did not take into account that the parent of a send node with a block is the block node itself.
    
    After this change, the code below is lawful:
    
    ```ruby
    foo(a) || bar(b) do
      pass
    end
    ```
    gsamokovarov committed Jan 9, 2020
    Copy the full SHA
    c7d6d76 View commit details
    Browse the repository at this point in the history