-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
… an operator method argument is chained Update `Style/BlockDelimiters` to not register an offense when braces are necessary to avoid changing precedence. Previously when an operator method was encountered, it was automatically evaluated (ie. not marked as ignored), but this can result in block delimiters being changed that affects block binding. Now operator methods are evaluated for nodes to ignore, other than if it only has a single argument which is of block type. As well, I added the missing `expect_corrections` tests for offenses without it.
- Loading branch information
1 parent
522950a
commit fd13dab
Showing
3 changed files
with
137 additions
and
31 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_fix_style_block_delimiters_when_an_operator_method.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 @@ | ||
* [#13299](https://github.com/rubocop/rubocop/issues/13299): Fix `Style/BlockDelimiters` to always accept braces when an operator method argument is chained. ([@dvandersluis][]) |
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