-
-
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.
Fix an incorrect autocorrect for
Layout/ClassStructure
when definit…
…ions that need to be sorted are defined alternately This PR is fix an incorrect autocorrect for `Layout/ClassStructure` when definitions that need to be sorted are defined alternately. ## Code to reproduce ```ruby class A private def foo; end def bar; end private def baz; end def qux; end end ``` ## Expected behavior Automatically corrected as follows: ```ruby class A def bar; end def qux; end private def foo; end private def baz; end end ``` ## Actual behavior Automatically corrected as follows: ```ruby class A def qux; end def bar; end def qux; end # <------ Duplicate private def foo; end private def baz; end end ```
- Loading branch information
Showing
3 changed files
with
34 additions
and
19 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_an_incorrect_autocorrect_for_layout_class_structure.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 @@ | ||
* [#11529](https://github.com/rubocop/rubocop/pull/11529): Fix an incorrect autocorrect for `Layout/ClassStructure` when definitions that need to be sorted are defined alternately. ([@ydah][]) |
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