Skip to content

Commit

Permalink
Suppress a RuboCop offense
Browse files Browse the repository at this point in the history
This commit suppresses the following RuboCop offense:

```console
$ bundle exec rubocop
(snip)

lib/rubocop/cop/performance/redundant_match.rb:75:26: C: [Correctable] InternalAffairs/OperatorKeyword: Use arg.operator_keyword?.
return true if arg.and_type? || arg.or_type? || arg.range_type?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

120 files inspected, 1 offense detected, 1 offense autocorrectable
```
  • Loading branch information
koic committed Nov 15, 2024
1 parent 860c55b commit 378299f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/redundant_match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def replacement(node)

def requires_parentheses?(arg)
return true if arg.if_type? && arg.ternary?
return true if arg.and_type? || arg.or_type? || arg.range_type?
return true if arg.operator_keyword? || arg.range_type?

call_like?(arg) && requires_parentheses_for_call_like?(arg)
end
Expand Down

0 comments on commit 378299f

Please sign in to comment.