forked from rubocop/rubocop
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…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.
- Loading branch information
Showing
4 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/new_add_allow_if_method_has_arguments_option_to_style_symbol_proc.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#9525](https://github.com/rubocop-hq/rubocop/issues/9525): Add `AllowMethodsWithArguments` option to `Style/SymbolProc`. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters