Skip to content

Commit

Permalink
Suppress new Style/ReturnNilInPredicateMethodDefinition offenses
Browse files Browse the repository at this point in the history
Follow up rubocop/rubocop#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
```
  • Loading branch information
koic committed Jun 23, 2023
1 parent 1d22edf commit 563eb44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/performance/fixed_size.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 563eb44

Please sign in to comment.