Skip to content

Style/RedundantParentheses false positive when yield is used #14486

@yegor256

Description

@yegor256

This is my code:

next if block_given? && (!yield f)

Rubocop 1.80 says this:

C: [Correctable] Style/RedundantParentheses: Don't use parentheses around a unary operation.
    next if block_given? && (!yield f)

However, I can't remove parentheses and not break the syntax

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions