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

Style/AccessorGrouping: Fix sibling detection for methods with type sigs #11675

Merged

Commits on Mar 7, 2023

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