From 378299fddc9b300f6dbdd2f6231193702b97116b Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sat, 16 Nov 2024 07:45:54 +0800 Subject: [PATCH] Suppress a RuboCop offense 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 ``` --- lib/rubocop/cop/performance/redundant_match.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rubocop/cop/performance/redundant_match.rb b/lib/rubocop/cop/performance/redundant_match.rb index a4dc15b56e..d5d2c4cb16 100644 --- a/lib/rubocop/cop/performance/redundant_match.rb +++ b/lib/rubocop/cop/performance/redundant_match.rb @@ -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