Skip to content

Commit

Permalink
Suppress RuboCop's offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Jan 31, 2025
1 parent 2d36cac commit 349ae04
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/fixed_size.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def allowed_argument?(arg)
end

def allowed_parent?(node)
node && (node.casgn_type? || node.block_type?)
node&.type?(:casgn, :block)
end

def contains_splat?(node)
Expand Down
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 @@ -84,7 +84,7 @@ def requires_parentheses_for_call_like?(arg)
end

def call_like?(arg)
arg.call_type? || arg.yield_type? || arg.super_type?
arg.type?(:call, :yield, :super)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/regexp_match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def scope_body(node)

def scope_root(node)
node.each_ancestor.find do |ancestor|
ancestor.def_type? || ancestor.defs_type? || ancestor.class_type? || ancestor.module_type?
ancestor.type?(:def, :defs, :class, :module)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/times_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def check(node)

def handleable_receiver?(node)
receiver = node.receiver.receiver
return true if receiver.literal? && (receiver.int_type? || receiver.float_type?)
return true if receiver.literal? && receiver.type?(:int, :float)

node.receiver.dot?
end
Expand Down

0 comments on commit 349ae04

Please sign in to comment.