rubocop 0.72.0 → 0.73.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/config/default.yml +13 -0
- data/lib/rubocop.rb +2 -0
- data/lib/rubocop/ast/node.rb +8 -8
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +16 -5
- data/lib/rubocop/ast/traversal.rb +3 -3
- data/lib/rubocop/cop/autocorrect_logic.rb +71 -1
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +1 -1
- data/lib/rubocop/cop/bundler/ordered_gems.rb +1 -1
- data/lib/rubocop/cop/commissioner.rb +3 -9
- data/lib/rubocop/cop/cop.rb +36 -6
- data/lib/rubocop/cop/corrector.rb +2 -3
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +2 -2
- data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +2 -2
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -1
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +1 -1
- data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +1 -1
- data/lib/rubocop/cop/generator.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/node_destructuring.rb +2 -2
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +2 -2
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +2 -2
- data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +2 -2
- data/lib/rubocop/cop/layout/block_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/class_structure.rb +1 -1
- data/lib/rubocop/cop/layout/indent_first_argument.rb +1 -1
- data/lib/rubocop/cop/layout/indent_heredoc.rb +3 -2
- data/lib/rubocop/cop/layout/indentation_width.rb +1 -1
- data/lib/rubocop/cop/layout/leading_comment_space.rb +28 -0
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +18 -4
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +14 -2
- data/lib/rubocop/cop/layout/tab.rb +10 -22
- data/lib/rubocop/cop/lint/big_decimal_new.rb +1 -1
- data/lib/rubocop/cop/lint/debugger.rb +3 -3
- data/lib/rubocop/cop/lint/duplicate_methods.rb +3 -3
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +1 -1
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +1 -1
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +1 -1
- data/lib/rubocop/cop/lint/inherit_exception.rb +1 -1
- data/lib/rubocop/cop/lint/multiple_compare.rb +1 -1
- data/lib/rubocop/cop/lint/nested_method_definition.rb +3 -3
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +1 -1
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +1 -1
- data/lib/rubocop/cop/lint/number_conversion.rb +2 -2
- data/lib/rubocop/cop/lint/rand_one.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_with_index.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_with_object.rb +1 -1
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +5 -5
- data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +1 -1
- data/lib/rubocop/cop/lint/unified_integer.rb +1 -1
- data/lib/rubocop/cop/lint/unneeded_require_statement.rb +1 -1
- data/lib/rubocop/cop/lint/unneeded_splat_expansion.rb +1 -1
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +1 -1
- data/lib/rubocop/cop/lint/uri_regexp.rb +2 -2
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +6 -6
- data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
- data/lib/rubocop/cop/metrics/class_length.rb +1 -1
- data/lib/rubocop/cop/metrics/module_length.rb +1 -1
- data/lib/rubocop/cop/metrics/parameter_lists.rb +1 -1
- data/lib/rubocop/cop/mixin/def_node.rb +1 -1
- data/lib/rubocop/cop/mixin/empty_parameter.rb +1 -1
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +4 -4
- data/lib/rubocop/cop/mixin/method_complexity.rb +1 -1
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +3 -3
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/constant_name.rb +2 -2
- data/lib/rubocop/cop/naming/predicate_name.rb +1 -1
- data/lib/rubocop/cop/security/eval.rb +1 -1
- data/lib/rubocop/cop/security/json_load.rb +1 -1
- data/lib/rubocop/cop/security/marshal_load.rb +1 -1
- data/lib/rubocop/cop/security/open.rb +1 -1
- data/lib/rubocop/cop/security/yaml_load.rb +1 -1
- data/lib/rubocop/cop/style/alias.rb +1 -1
- data/lib/rubocop/cop/style/colon_method_call.rb +1 -1
- data/lib/rubocop/cop/style/conditional_assignment.rb +1 -1
- data/lib/rubocop/cop/style/constant_visibility.rb +1 -1
- data/lib/rubocop/cop/style/date_time.rb +3 -3
- data/lib/rubocop/cop/style/dir.rb +1 -1
- data/lib/rubocop/cop/style/documentation_method.rb +1 -1
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +49 -0
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +1 -1
- data/lib/rubocop/cop/style/each_with_object.rb +1 -1
- data/lib/rubocop/cop/style/eval_with_location.rb +2 -2
- data/lib/rubocop/cop/style/even_odd.rb +1 -1
- data/lib/rubocop/cop/style/expand_path_arguments.rb +3 -3
- data/lib/rubocop/cop/style/float_division.rb +4 -4
- data/lib/rubocop/cop/style/format_string.rb +7 -7
- data/lib/rubocop/cop/style/hash_syntax.rb +2 -2
- data/lib/rubocop/cop/style/inverse_methods.rb +2 -2
- data/lib/rubocop/cop/style/min_max.rb +1 -1
- data/lib/rubocop/cop/style/mixin_usage.rb +1 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +55 -0
- data/lib/rubocop/cop/style/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/style/mutable_constant.rb +3 -3
- data/lib/rubocop/cop/style/numeric_predicate.rb +3 -3
- data/lib/rubocop/cop/style/option_hash.rb +1 -1
- data/lib/rubocop/cop/style/or_assignment.rb +2 -2
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +1 -1
- data/lib/rubocop/cop/style/random_with_offset.rb +6 -6
- data/lib/rubocop/cop/style/redundant_conditional.rb +2 -2
- data/lib/rubocop/cop/style/redundant_exception.rb +2 -2
- data/lib/rubocop/cop/style/redundant_freeze.rb +1 -1
- data/lib/rubocop/cop/style/redundant_parentheses.rb +2 -2
- data/lib/rubocop/cop/style/redundant_sort_by.rb +1 -1
- data/lib/rubocop/cop/style/rescue_standard_error.rb +2 -2
- data/lib/rubocop/cop/style/return_nil.rb +1 -1
- data/lib/rubocop/cop/style/safe_navigation.rb +1 -1
- data/lib/rubocop/cop/style/sample.rb +1 -1
- data/lib/rubocop/cop/style/stderr_puts.rb +1 -1
- data/lib/rubocop/cop/style/string_hash_keys.rb +2 -2
- data/lib/rubocop/cop/style/strip.rb +1 -1
- data/lib/rubocop/cop/style/struct_inheritance.rb +3 -3
- data/lib/rubocop/cop/style/symbol_proc.rb +1 -1
- data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/trivial_accessors.rb +1 -1
- data/lib/rubocop/cop/style/unneeded_sort.rb +1 -1
- data/lib/rubocop/cop/style/unpack_first.rb +1 -1
- data/lib/rubocop/cop/style/zero_length_predicate.rb +5 -5
- data/lib/rubocop/cop/team.rb +15 -14
- data/lib/rubocop/error.rb +23 -0
- data/lib/rubocop/node_pattern.rb +2 -2
- data/lib/rubocop/options.rb +17 -0
- data/lib/rubocop/rspec/shared_contexts.rb +12 -0
- data/lib/rubocop/target_finder.rb +6 -4
- data/lib/rubocop/version.rb +1 -1
- metadata +4 -2
@@ -24,7 +24,7 @@ module RuboCop
|
|
24
24
|
class EachWithObjectArgument < Cop
|
25
25
|
MSG = 'The argument to each_with_object can not be immutable.'
|
26
26
|
|
27
|
-
def_node_matcher :each_with_object?,
|
27
|
+
def_node_matcher :each_with_object?, <<~PATTERN
|
28
28
|
({send csend} _ :each_with_object $_)
|
29
29
|
PATTERN
|
30
30
|
|
@@ -76,7 +76,7 @@ module RuboCop
|
|
76
76
|
'`ERB.new(str, eoutvar: %<arg_value>s)` instead.'
|
77
77
|
].freeze
|
78
78
|
|
79
|
-
def_node_matcher :erb_new_with_non_keyword_arguments,
|
79
|
+
def_node_matcher :erb_new_with_non_keyword_arguments, <<~PATTERN
|
80
80
|
(send
|
81
81
|
(const {nil? cbase} :ERB) :new $...)
|
82
82
|
PATTERN
|
@@ -53,7 +53,7 @@ module RuboCop
|
|
53
53
|
ALTERNATIVE_PROTECTED = '`protected` inside a `class << self` ' \
|
54
54
|
'block'
|
55
55
|
|
56
|
-
def_node_search :private_class_methods,
|
56
|
+
def_node_search :private_class_methods, <<~PATTERN
|
57
57
|
(send nil? :private_class_method $...)
|
58
58
|
PATTERN
|
59
59
|
|
@@ -24,7 +24,7 @@ module RuboCop
|
|
24
24
|
class MultipleCompare < Cop
|
25
25
|
MSG = 'Use the `&&` operator to compare multiple values.'
|
26
26
|
|
27
|
-
def_node_matcher :multiple_compare?,
|
27
|
+
def_node_matcher :multiple_compare?, <<~PATTERN
|
28
28
|
(send (send _ {:< :> :<= :>=} $_) {:< :> :<= :>=} _)
|
29
29
|
PATTERN
|
30
30
|
|
@@ -87,15 +87,15 @@ module RuboCop
|
|
87
87
|
class_or_module_or_struct_new_call?(child)
|
88
88
|
end
|
89
89
|
|
90
|
-
def_node_matcher :eval_call?,
|
90
|
+
def_node_matcher :eval_call?, <<~PATTERN
|
91
91
|
(block (send _ {:instance_eval :class_eval :module_eval} ...) ...)
|
92
92
|
PATTERN
|
93
93
|
|
94
|
-
def_node_matcher :exec_call?,
|
94
|
+
def_node_matcher :exec_call?, <<~PATTERN
|
95
95
|
(block (send _ {:instance_exec :class_exec :module_exec} ...) ...)
|
96
96
|
PATTERN
|
97
97
|
|
98
|
-
def_node_matcher :class_or_module_or_struct_new_call?,
|
98
|
+
def_node_matcher :class_or_module_or_struct_new_call?, <<~PATTERN
|
99
99
|
(block (send (const nil? {:Class :Module :Struct}) :new ...) ...)
|
100
100
|
PATTERN
|
101
101
|
end
|
@@ -25,7 +25,7 @@ module RuboCop
|
|
25
25
|
class NextWithoutAccumulator < Cop
|
26
26
|
MSG = 'Use `next` with an accumulator argument in a `reduce`.'
|
27
27
|
|
28
|
-
def_node_matcher :on_body_of_reduce,
|
28
|
+
def_node_matcher :on_body_of_reduce, <<~PATTERN
|
29
29
|
(block (send _recv {:reduce :inject} !sym) _blockargs $(begin ...))
|
30
30
|
PATTERN
|
31
31
|
|
@@ -31,11 +31,11 @@ module RuboCop
|
|
31
31
|
'%<number_object>s.%<to_method>s, use stricter '\
|
32
32
|
'%<corrected_method>s.'
|
33
33
|
|
34
|
-
def_node_matcher :to_method,
|
34
|
+
def_node_matcher :to_method, <<~PATTERN
|
35
35
|
(send $_ ${:to_i :to_f :to_c})
|
36
36
|
PATTERN
|
37
37
|
|
38
|
-
def_node_matcher :datetime?,
|
38
|
+
def_node_matcher :datetime?, <<~PATTERN
|
39
39
|
(send (const {nil? (cbase)} {:Time :DateTime}) ...)
|
40
40
|
PATTERN
|
41
41
|
|
@@ -24,7 +24,7 @@ module RuboCop
|
|
24
24
|
MSG = '`%<method>s` always returns `0`. ' \
|
25
25
|
'Perhaps you meant `rand(2)` or `rand`?'
|
26
26
|
|
27
|
-
def_node_matcher :rand_one?,
|
27
|
+
def_node_matcher :rand_one?, <<~PATTERN
|
28
28
|
(send {(const nil? :Kernel) nil?} :rand {(int {-1 1}) (float {-1.0 1.0})})
|
29
29
|
PATTERN
|
30
30
|
|
@@ -32,7 +32,7 @@ module RuboCop
|
|
32
32
|
MSG_EACH_WITH_INDEX = 'Use `each` instead of `each_with_index`.'
|
33
33
|
MSG_WITH_INDEX = 'Remove redundant `with_index`.'
|
34
34
|
|
35
|
-
def_node_matcher :redundant_with_index?,
|
35
|
+
def_node_matcher :redundant_with_index?, <<~PATTERN
|
36
36
|
(block
|
37
37
|
$(send
|
38
38
|
_ {:each_with_index :with_index} ...)
|
@@ -29,11 +29,11 @@ module RuboCop
|
|
29
29
|
MSG = 'Do not chain ordinary method call' \
|
30
30
|
' after safe navigation operator.'
|
31
31
|
|
32
|
-
def_node_matcher :bad_method?,
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
def_node_matcher :bad_method?, <<~PATTERN
|
33
|
+
{
|
34
|
+
(send $(csend ...) $_ ...)
|
35
|
+
(send $(block (csend ...) ...) $_ ...)
|
36
|
+
}
|
37
37
|
PATTERN
|
38
38
|
|
39
39
|
def on_send(node)
|
@@ -23,7 +23,7 @@ module RuboCop
|
|
23
23
|
MSG = 'Avoid calling `empty?` with the safe navigation operator ' \
|
24
24
|
'in conditionals.'
|
25
25
|
|
26
|
-
def_node_matcher :safe_navigation_empty_in_conditional?,
|
26
|
+
def_node_matcher :safe_navigation_empty_in_conditional?, <<~PATTERN
|
27
27
|
(if (csend (send ...) :empty?) ...)
|
28
28
|
PATTERN
|
29
29
|
|
@@ -20,7 +20,7 @@ module RuboCop
|
|
20
20
|
class UnifiedInteger < Cop
|
21
21
|
MSG = 'Use `Integer` instead of `%<klass>s`.'
|
22
22
|
|
23
|
-
def_node_matcher :fixnum_or_bignum_const,
|
23
|
+
def_node_matcher :fixnum_or_bignum_const, <<~PATTERN
|
24
24
|
(:const {nil? (:cbase)} ${:Fixnum :Bignum})
|
25
25
|
PATTERN
|
26
26
|
|
@@ -26,7 +26,7 @@ module RuboCop
|
|
26
26
|
|
27
27
|
MSG = 'Remove unnecessary `require` statement.'
|
28
28
|
|
29
|
-
def_node_matcher :unnecessary_require_statement?,
|
29
|
+
def_node_matcher :unnecessary_require_statement?, <<~PATTERN
|
30
30
|
(send nil? :require
|
31
31
|
(str {"enumerator" "rational" "complex" "thread"}))
|
32
32
|
PATTERN
|
@@ -60,7 +60,7 @@ module RuboCop
|
|
60
60
|
|
61
61
|
def_node_matcher :array_new?, '$(send (const nil? :Array) :new ...)'
|
62
62
|
|
63
|
-
def_node_matcher :literal_expansion,
|
63
|
+
def_node_matcher :literal_expansion, <<~PATTERN
|
64
64
|
(splat {$({str dstr int float array} ...) (block $#array_new? ...) $#array_new?} ...)
|
65
65
|
PATTERN
|
66
66
|
|
@@ -45,7 +45,7 @@ module RuboCop
|
|
45
45
|
'Instead, use %<replacements>s depending on your specific use ' \
|
46
46
|
'case.'
|
47
47
|
|
48
|
-
def_node_matcher :uri_escape_unescape?,
|
48
|
+
def_node_matcher :uri_escape_unescape?, <<~PATTERN
|
49
49
|
(send
|
50
50
|
(const ${nil? cbase} :URI) ${:escape :encode :unescape :decode}
|
51
51
|
...)
|
@@ -18,13 +18,13 @@ module RuboCop
|
|
18
18
|
'be used. Instead, use `%<top_level>sURI::DEFAULT_PARSER.' \
|
19
19
|
'make_regexp%<arg>s`.'
|
20
20
|
|
21
|
-
def_node_matcher :uri_regexp_with_argument?,
|
21
|
+
def_node_matcher :uri_regexp_with_argument?, <<~PATTERN
|
22
22
|
(send
|
23
23
|
(const ${nil? cbase} :URI) :regexp
|
24
24
|
(str $_))
|
25
25
|
PATTERN
|
26
26
|
|
27
|
-
def_node_matcher :uri_regexp_without_argument?,
|
27
|
+
def_node_matcher :uri_regexp_without_argument?, <<~PATTERN
|
28
28
|
(send
|
29
29
|
(const ${nil? cbase} :URI) :regexp)
|
30
30
|
PATTERN
|
@@ -113,19 +113,19 @@ module RuboCop
|
|
113
113
|
|
114
114
|
private
|
115
115
|
|
116
|
-
def_node_matcher :static_method_definition?,
|
116
|
+
def_node_matcher :static_method_definition?, <<~PATTERN
|
117
117
|
{def (send nil? {:attr :attr_reader :attr_writer :attr_accessor} ...)}
|
118
118
|
PATTERN
|
119
119
|
|
120
|
-
def_node_matcher :dynamic_method_definition?,
|
120
|
+
def_node_matcher :dynamic_method_definition?, <<~PATTERN
|
121
121
|
{(send nil? :define_method ...) (block (send nil? :define_method ...) ...)}
|
122
122
|
PATTERN
|
123
123
|
|
124
|
-
def_node_matcher :class_or_instance_eval?,
|
124
|
+
def_node_matcher :class_or_instance_eval?, <<~PATTERN
|
125
125
|
(block (send _ {:class_eval :instance_eval}) ...)
|
126
126
|
PATTERN
|
127
127
|
|
128
|
-
def_node_matcher :class_or_module_or_struct_new_call?,
|
128
|
+
def_node_matcher :class_or_module_or_struct_new_call?, <<~PATTERN
|
129
129
|
(block (send (const nil? {:Class :Module :Struct}) :new ...) ...)
|
130
130
|
PATTERN
|
131
131
|
|
@@ -202,7 +202,7 @@ module RuboCop
|
|
202
202
|
cop_config.fetch('MethodCreatingMethods', []).any? do |m|
|
203
203
|
matcher_name = "#{m}_method?".to_sym
|
204
204
|
unless respond_to?(matcher_name)
|
205
|
-
self.class.def_node_matcher matcher_name,
|
205
|
+
self.class.def_node_matcher matcher_name, <<~PATTERN
|
206
206
|
{def (send nil? :#{m} ...)}
|
207
207
|
PATTERN
|
208
208
|
end
|
@@ -226,7 +226,7 @@ module RuboCop
|
|
226
226
|
cop_config.fetch('ContextCreatingMethods', []).any? do |m|
|
227
227
|
matcher_name = "#{m}_block?".to_sym
|
228
228
|
unless respond_to?(matcher_name)
|
229
|
-
self.class.def_node_matcher matcher_name,
|
229
|
+
self.class.def_node_matcher matcher_name, <<~PATTERN
|
230
230
|
(block (send {nil? const} {:#{m}} ...) ...)
|
231
231
|
PATTERN
|
232
232
|
end
|
@@ -5,12 +5,12 @@ module RuboCop
|
|
5
5
|
# Common functionality for enforcing a specific superclass
|
6
6
|
module EnforceSuperclass
|
7
7
|
def self.included(base)
|
8
|
-
base.def_node_matcher :class_definition,
|
9
|
-
|
8
|
+
base.def_node_matcher :class_definition, <<~PATTERN
|
9
|
+
(class (const _ !:#{base::SUPERCLASS}) #{base::BASE_PATTERN} ...)
|
10
10
|
PATTERN
|
11
11
|
|
12
|
-
base.def_node_matcher :class_new_definition,
|
13
|
-
|
12
|
+
base.def_node_matcher :class_new_definition, <<~PATTERN
|
13
|
+
[!^(casgn nil? :#{base::SUPERCLASS} ...) (send (const nil? :Class) :new #{base::BASE_PATTERN})]
|
14
14
|
PATTERN
|
15
15
|
end
|
16
16
|
|
@@ -159,11 +159,11 @@ module RuboCop
|
|
159
159
|
break false if a.block_type?
|
160
160
|
|
161
161
|
next if a.setter_method?
|
162
|
+
next unless kind == :with_or_without_parentheses ||
|
163
|
+
kind == :with_parentheses && parentheses?(a)
|
162
164
|
|
163
165
|
a.arguments.any? do |arg|
|
164
|
-
within_node?(node, arg)
|
165
|
-
kind == :with_parentheses &&
|
166
|
-
parentheses?(node.parent))
|
166
|
+
within_node?(node, arg)
|
167
167
|
end
|
168
168
|
end
|
169
169
|
end
|
@@ -20,7 +20,7 @@ module RuboCop
|
|
20
20
|
OP_LIKE_METHODS = %i[eql? equal?].freeze
|
21
21
|
BLACKLISTED = %i[+@ -@ [] []= << === `].freeze
|
22
22
|
|
23
|
-
def_node_matcher :op_method_candidate?,
|
23
|
+
def_node_matcher :op_method_candidate?, <<~PATTERN
|
24
24
|
(def [#op_method? $_] (args $(arg [!:other !:_other])) _)
|
25
25
|
PATTERN
|
26
26
|
|
@@ -23,7 +23,7 @@ module RuboCop
|
|
23
23
|
# than just standard ASCII characters
|
24
24
|
SNAKE_CASE = /^[[:digit:][:upper:]_]+$/.freeze
|
25
25
|
|
26
|
-
def_node_matcher :class_or_struct_return_method?,
|
26
|
+
def_node_matcher :class_or_struct_return_method?, <<~PATTERN
|
27
27
|
(send
|
28
28
|
(const _ {:Class :Struct}) :new
|
29
29
|
...)
|
@@ -63,7 +63,7 @@ module RuboCop
|
|
63
63
|
(node.receiver.nil? || !literal_receiver?(node))
|
64
64
|
end
|
65
65
|
|
66
|
-
def_node_matcher :literal_receiver?,
|
66
|
+
def_node_matcher :literal_receiver?, <<~PATTERN
|
67
67
|
{(send literal? ...)
|
68
68
|
(send (begin literal?) ...)}
|
69
69
|
PATTERN
|
@@ -21,7 +21,7 @@ module RuboCop
|
|
21
21
|
class MarshalLoad < Cop
|
22
22
|
MSG = 'Avoid using `Marshal.%<method>s`.'
|
23
23
|
|
24
|
-
def_node_matcher :marshal_load,
|
24
|
+
def_node_matcher :marshal_load, <<~PATTERN
|
25
25
|
(send (const {nil? cbase} :Marshal) ${:load :restore}
|
26
26
|
!(send (const {nil? cbase} :Marshal) :dump ...))
|
27
27
|
PATTERN
|