We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
def_node_matcher
1 parent a80d92b commit 01fdcbbCopy full SHA for 01fdcbb
lib/rubocop/cop/style/redundant_fetch_block.rb
@@ -49,7 +49,7 @@ class RedundantFetchBlock < Base
49
(block
50
$(call _ :fetch _)
51
(args)
52
- ${nil? #basic_literal? #const_type?})
+ ${nil? basic_literal? const_type?})
53
PATTERN
54
55
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
@@ -71,14 +71,6 @@ def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
71
72
private
73
74
- def basic_literal?(node)
75
- node&.basic_literal?
76
- end
77
-
78
- def const_type?(node)
79
- node&.const_type?
80
81
82
def should_not_check?(send, body)
83
(body&.const_type? && !check_for_constant?) ||
84
(body&.str_type? && !check_for_string?) ||
0 commit comments