From 563eb44c085fc1255070a31841c296e6e3ccc46f Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Fri, 23 Jun 2023 14:01:04 +0900 Subject: [PATCH] Suppress new `Style/ReturnNilInPredicateMethodDefinition` offenses Follow up https://github.com/rubocop/rubocop/pull/11967. This commit suppresses the following new `Style/ReturnNilInPredicateMethodDefinition` offenses: ```console $ bundle exec rubocop (snip) Offenses: lib/rubocop/cop/performance/fixed_size.rb:81:11: C: [Correctable] Style/ReturnNilInPredicateMethodDefinition: Use return false instead of return in the predicate method. return unless node.array_type? ^^^^^^ lib/rubocop/cop/performance/fixed_size.rb:87:11: C: [Correctable] Style/ReturnNilInPredicateMethodDefinition: Use return false instead of return in the predicate method. return unless node.hash_type? ^^^^^^ 116 files inspected, 2 offenses detected, 2 offenses autocorrectable ``` --- lib/rubocop/cop/performance/fixed_size.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rubocop/cop/performance/fixed_size.rb b/lib/rubocop/cop/performance/fixed_size.rb index 01959f2130..0eff8fcb48 100644 --- a/lib/rubocop/cop/performance/fixed_size.rb +++ b/lib/rubocop/cop/performance/fixed_size.rb @@ -78,13 +78,13 @@ def allowed_parent?(node) end def contains_splat?(node) - return unless node.array_type? + return false unless node.array_type? node.each_child_node(:splat).any? end def contains_double_splat?(node) - return unless node.hash_type? + return false unless node.hash_type? node.each_child_node(:kwsplat).any? end