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 #9525] Add AllowIfMethodWithArguments option to Style/SymbolProc #9535

Commits on Feb 25, 2021

  1. [Fix rubocop#9525] Add AllowMethodsWithArguments option to `Style/S…

    …ymbolProc`
    
    ## Summary
    
    Fixes rubocop#9525.
    
    This PR adds `AllowMethodsWithArguments` option to `Style/SymbolProc`.
    
    ### `AllowMethodsWithArguments: false` (default)
    
    ```ruby
    # bad
    something.do_something(foo) { |o| o.bar }
    
    # good
    something.do_something(foo, &:bar)
    ```
    
    ### `AllowMethodsWithArguments: true`
    
    ```ruby
    # good
    something.do_something(foo) { |o| o.bar }
    ```
    
    If user prefer a style that allows block for method with arguments,
    the user can set `true` to `AllowMethodsWithArguments`.
    
    ## Other Information
    
    It may be possible to consider defaulting to `AllowMethodsWithArguments: true`,
    but at the time of this patch `Style/SymbolProc` cop respect keeping the existing behavior.
    koic committed Feb 25, 2021
    Configuration menu
    Copy the full SHA
    db955e3 View commit details
    Browse the repository at this point in the history