Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an incorrect autocorrect for Layout/ClassStructure when definitions that need to be sorted are defined alternately #11529

Merged

Commits on Feb 1, 2023

  1. 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
    ```
    ydah committed Feb 1, 2023
    Configuration menu
    Copy the full SHA
    1a1c4ff View commit details
    Browse the repository at this point in the history