forked from rubocop/rubocop
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Style/AccessorGrouping: Fix detection of Sorbet
sig {}
blocks
- Sorbet `sig { returns(Integer) }` annotations above `attr_reader` methods should be ignored after 9921cdc, per the docs, but they weren't being. - Sorbet `sig {}` constructs are blocks (hence the braces), not `send_type?` directly. - Hence, we now check if the previous expression is a block and if so, descend into its child nodes until we find a `send_type`, then use that to determine if the accessor is groupable. - Relates to rubocop#11596.
- Loading branch information
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_style_accessor_grouping_fix_detection_of_sorbet.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 @@ | ||
* [#11650](https://github.com/rubocop/rubocop/pull/11650): `Style/AccessorGrouping`: Fix detection of Sorbet `sig {}` blocks. ([@issyl0][]) |
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