-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 sibling detection for methods with type sigs
- Over in `Homebrew/brew`, trying to enable this cop after 008506d was released, we were seeing the following offenses which were incorrect since we can't combine attrs that follow on from typed ones. - This commit ensures that sibling accessors are groupable before raising an offense that they should be grouped. - Also add more tests to ensure the offense detection and subsequent autocorrection still works. ``` sig { returns(Pathname) } attr_reader :cached_location attr_reader :cache, :meta, :name, :version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Group together all `attr_reader` attributes ```
- Loading branch information
Showing
3 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_style_accessor_grouping_fix_sibling_detection_for.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 @@ | ||
* [#11675](https://github.com/rubocop/rubocop/pull/11675): `Style/AccessorGrouping`: Fix sibling detection for methods with type sigs. ([@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