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 detection of Sorbet sig {} blocks #11650

Merged

Commits on Mar 2, 2023

  1. Style/AccessorGrouping: Fix detection of Sorbet sig {} blocks

    - Sorbet `sig { returns(Integer) }` annotations above `attr_reader`
      methods should be ignored after
      9921cdc, per the docs, but they
      weren't being.
    - Sorbet `sig {}` constructs are blocks (hence the braces), not
      `send_type?` directly.
    - Hence, we now check if the previous expression is a block and if so,
      descend into its child nodes until we find a `send_type`, then use
      that to determine if the accessor is groupable.
    - Relates to rubocop#11596.
    issyl0 committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    7fa0439 View commit details
    Browse the repository at this point in the history