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

Calls with braces in interpolation for Style/MethodCallWithArgsParentheses #9629

Merged

Commits on Mar 22, 2021

  1. Calls with braces in interpolation for Style/MethodCallWithArgsParent…

    …heses
    
    If we are calling methods in string interpolation with the `omit_parentheses`
    style for the `Style/MethodCallWithArgsParentheses` cop, they are
    currently forced to be without parentheses:
    
    ```ruby
    "#{part 1}, #{part 2}, #{part 3}"
    ```
    
    My coworkers at Dext want to be able to put spaces while calling methods
    in interpolation, and I don't blame them. Having spaces reduces the
    noise of following a method call in a string, especially if the string
    happens to have multiple interpolations in it.
    
    I want to add the `AllowParenthesesInStringInterpolation` cop configuration
    that allows the use of parentheses in string interpolation calls.
    
    ```ruby
    "#{part(1)}, #{part(2)}, #{part(3)}"
    ```
    gsamokovarov committed Mar 22, 2021
    Copy the full SHA
    a34a957 View commit details
    Browse the repository at this point in the history