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

False negative on Layout/MultilineMethodCallIndentation for safe navigation #12199

Closed
brkn opened this issue Sep 10, 2023 · 0 comments · Fixed by #12201
Closed

False negative on Layout/MultilineMethodCallIndentation for safe navigation #12199

brkn opened this issue Sep 10, 2023 · 0 comments · Fixed by #12201
Labels

Comments

@brkn
Copy link
Contributor

brkn commented Sep 10, 2023

Layout/MultilineMethodCallIndentation doesn't catch safe navigation chains.

Current behaviour

This is considered correctly aligned.

# frozen_string_literal: true

author.books
      .first
    &.tags
        &.map { |tag| "tag: #{tag}" }

1 file inspected, no offenses detected

Describe the solution you'd like

It should correctly align multiline chains whether it has safe navigation or not.

Additional context

> rubocop -v
1.56.2
@koic koic added the bug label Sep 11, 2023
koic added a commit to koic/rubocop that referenced this issue Sep 11, 2023
…llIndentation`

Fixes rubocop#12199.

This PR fixes false negatives for `Layout/MultilineMethodCallIndentation`
when using safe navigation operator.
bbatsov pushed a commit that referenced this issue Sep 12, 2023
…tation`

Fixes #12199.

This PR fixes false negatives for `Layout/MultilineMethodCallIndentation`
when using safe navigation operator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants