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 Style/AccessModifierDeclarations when multiple groupable access modifiers are defined #11530

Merged
merged 1 commit into from
Feb 2, 2023

Commits on Feb 2, 2023

  1. Fix an incorrect autocorrect for Style/AccessModifierDeclarations w…

    …hen multiple groupable access modifiers are defined
    
    This PR is fix an incorrect autocorrect for `Style/AccessModifierDeclarations` when multiple groupable access modifiers are defined.
    
    ## Code to reproduce
    
    ```ruby
    class Test
      private def foo; end
      private def bar; end
      def baz; end
    end
    ```
    
    ## Expected behavior
    
    Automatically corrected as follows:
    
    ```ruby
    class Test
      def baz; end
    
      private
    
      def foo; end
    
      def bar; end
    end
    ```
    
    ## Actual behavior
    
    Automatically corrected as follows:
    
    ```ruby
    class Test
      def baz; end
    private
    
    def bar; end # <--- The order is changing
    private # <--- Duplicate
    
    def foo; end # <--- The order is changing
    end
    ```
    ydah committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    a3d4077 View commit details
    Browse the repository at this point in the history