rubocop 1.69.0 → 1.69.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/generator.rb +6 -0
- data/lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb +1 -0
- data/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb +1 -2
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +4 -0
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +1 -0
- data/lib/rubocop/cop/lint/literal_as_condition.rb +1 -0
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +3 -3
- data/lib/rubocop/cop/lint/refinement_import_methods.rb +1 -1
- data/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb +3 -0
- data/lib/rubocop/cop/lint/unreachable_code.rb +51 -2
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +4 -0
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
- data/lib/rubocop/cop/naming/accessor_method_name.rb +6 -6
- data/lib/rubocop/cop/security/compound_hash.rb +1 -0
- data/lib/rubocop/cop/security/yaml_load.rb +3 -2
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +1 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +9 -1
- data/lib/rubocop/cop/style/dig_chain.rb +5 -6
- data/lib/rubocop/cop/style/fetch_env_var.rb +1 -0
- data/lib/rubocop/cop/style/hash_except.rb +19 -7
- data/lib/rubocop/cop/style/lambda_call.rb +3 -1
- data/lib/rubocop/cop/style/object_then.rb +1 -0
- data/lib/rubocop/cop/style/redundant_argument.rb +3 -1
- data/lib/rubocop/cop/style/redundant_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/redundant_self.rb +1 -1
- data/lib/rubocop/cop/style/string_concatenation.rb +13 -11
- data/lib/rubocop/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ab30572529c057731f5ebd7548808a1aa9f588f75a45ec0d41ecec2dbbc8015
|
4
|
+
data.tar.gz: 9beff10b3b9361a9ffc58c0da4920c9c7c7d1caa09e813ea96c46cd7f01683a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1fdca8813de85e849ba3ff5266c589b74986984192247fc53c541c81475ae672788a663444070fc5428cbfd1024de7cccc9ac7924fe0dab8e138069b3f6b8f7
|
7
|
+
data.tar.gz: 7896834ccaa34e897da918b457b7ab2c738e21b474536144ddbaf71af2d5ae1e829fdeb699701323f6c67d85cb7b2fb1adcc21f3fde1683cb6273387cd390ba2
|
@@ -71,11 +71,17 @@ module RuboCop
|
|
71
71
|
(send nil? :bad_method ...)
|
72
72
|
PATTERN
|
73
73
|
|
74
|
+
# Called on every `send` node (method call) while walking the AST.
|
75
|
+
# TODO: remove this method if inspecting `send` nodes is unneeded for your cop.
|
76
|
+
# By default, this is aliased to `on_csend` as well to handle method calls
|
77
|
+
# with safe navigation, remove the alias if this is unnecessary.
|
78
|
+
# If kept, ensure your tests cover safe navigation as well!
|
74
79
|
def on_send(node)
|
75
80
|
return unless bad_method?(node)
|
76
81
|
|
77
82
|
add_offense(node)
|
78
83
|
end
|
84
|
+
alias on_csend on_send
|
79
85
|
end
|
80
86
|
end
|
81
87
|
end
|
@@ -45,11 +45,10 @@ module RuboCop
|
|
45
45
|
#
|
46
46
|
class BinaryOperatorWithIdenticalOperands < Base
|
47
47
|
MSG = 'Binary operator `%<op>s` has identical operands.'
|
48
|
-
|
48
|
+
RESTRICT_ON_SEND = %i[== != === <=> =~ && || > >= < <= | ^].freeze
|
49
49
|
|
50
50
|
def on_send(node)
|
51
51
|
return unless node.binary_operation?
|
52
|
-
return if MATH_OPERATORS.include?(node.method_name)
|
53
52
|
return unless node.receiver == node.first_argument
|
54
53
|
|
55
54
|
add_offense(node, message: format(MSG, op: node.method_name))
|
@@ -37,8 +37,12 @@ module RuboCop
|
|
37
37
|
# dry_ingredients.combine
|
38
38
|
# end
|
39
39
|
class CircularArgumentReference < Base
|
40
|
+
extend TargetRubyVersion
|
41
|
+
|
40
42
|
MSG = 'Circular argument reference - `%<arg_name>s`.'
|
41
43
|
|
44
|
+
maximum_target_ruby_version 2.6
|
45
|
+
|
42
46
|
def on_kwoptarg(node)
|
43
47
|
check_for_circular_argument_references(*node)
|
44
48
|
end
|
@@ -59,11 +59,13 @@ module RuboCop
|
|
59
59
|
#
|
60
60
|
class NonDeterministicRequireOrder < Base
|
61
61
|
extend AutoCorrector
|
62
|
+
extend TargetRubyVersion
|
62
63
|
|
63
64
|
MSG = 'Sort files before requiring them.'
|
64
65
|
|
66
|
+
maximum_target_ruby_version 2.7
|
67
|
+
|
65
68
|
def on_block(node)
|
66
|
-
return if target_ruby_version >= 3.0
|
67
69
|
return unless node.body
|
68
70
|
return unless unsorted_dir_loop?(node.send_node)
|
69
71
|
|
@@ -75,7 +77,6 @@ module RuboCop
|
|
75
77
|
end
|
76
78
|
|
77
79
|
def on_numblock(node)
|
78
|
-
return if target_ruby_version >= 3.0
|
79
80
|
return unless node.body
|
80
81
|
return unless unsorted_dir_loop?(node.send_node)
|
81
82
|
|
@@ -87,7 +88,6 @@ module RuboCop
|
|
87
88
|
end
|
88
89
|
|
89
90
|
def on_block_pass(node)
|
90
|
-
return if target_ruby_version >= 3.0
|
91
91
|
return unless method_require?(node)
|
92
92
|
return unless unsorted_dir_pass?(node.parent)
|
93
93
|
|
@@ -6,7 +6,7 @@ module RuboCop
|
|
6
6
|
# Checks if `include` or `prepend` is called in `refine` block.
|
7
7
|
# These methods are deprecated and should be replaced with `Refinement#import_methods`.
|
8
8
|
#
|
9
|
-
# It emulates deprecation warnings in Ruby 3.1.
|
9
|
+
# It emulates deprecation warnings in Ruby 3.1. Functionality has been removed in Ruby 3.2.
|
10
10
|
#
|
11
11
|
# @safety
|
12
12
|
# This cop's autocorrection is unsafe because `include M` will affect the included class
|
@@ -58,6 +58,9 @@ module RuboCop
|
|
58
58
|
Regexp::Parser.parse(text.value)&.each_expression do |expr|
|
59
59
|
detect_offenses(text, expr)
|
60
60
|
end
|
61
|
+
rescue Regexp::Parser::ParserError
|
62
|
+
# Upon encountering an invalid regular expression,
|
63
|
+
# we aim to proceed and identify any remaining potential offenses.
|
61
64
|
end
|
62
65
|
end
|
63
66
|
|
@@ -32,6 +32,22 @@ module RuboCop
|
|
32
32
|
class UnreachableCode < Base
|
33
33
|
MSG = 'Unreachable code detected.'
|
34
34
|
|
35
|
+
def initialize(config = nil, options = nil)
|
36
|
+
super
|
37
|
+
@redefined = []
|
38
|
+
@instance_eval_count = 0
|
39
|
+
end
|
40
|
+
|
41
|
+
def on_block(node)
|
42
|
+
@instance_eval_count += 1 if instance_eval_block?(node)
|
43
|
+
end
|
44
|
+
|
45
|
+
alias on_numblock on_block
|
46
|
+
|
47
|
+
def after_block(node)
|
48
|
+
@instance_eval_count -= 1 if instance_eval_block?(node)
|
49
|
+
end
|
50
|
+
|
35
51
|
def on_begin(node)
|
36
52
|
expressions = *node
|
37
53
|
|
@@ -46,19 +62,23 @@ module RuboCop
|
|
46
62
|
|
47
63
|
private
|
48
64
|
|
65
|
+
def redefinable_flow_method?(method)
|
66
|
+
%i[raise fail throw exit exit! abort].include? method
|
67
|
+
end
|
68
|
+
|
49
69
|
# @!method flow_command?(node)
|
50
70
|
def_node_matcher :flow_command?, <<~PATTERN
|
51
71
|
{
|
52
72
|
return next break retry redo
|
53
73
|
(send
|
54
74
|
{nil? (const {nil? cbase} :Kernel)}
|
55
|
-
|
75
|
+
#redefinable_flow_method?
|
56
76
|
...)
|
57
77
|
}
|
58
78
|
PATTERN
|
59
79
|
|
60
80
|
def flow_expression?(node)
|
61
|
-
return
|
81
|
+
return report_on_flow_command?(node) if flow_command?(node)
|
62
82
|
|
63
83
|
case node.type
|
64
84
|
when :begin, :kwbegin
|
@@ -68,6 +88,8 @@ module RuboCop
|
|
68
88
|
check_if(node)
|
69
89
|
when :case, :case_match
|
70
90
|
check_case(node)
|
91
|
+
when :def
|
92
|
+
register_redefinition(node)
|
71
93
|
else
|
72
94
|
false
|
73
95
|
end
|
@@ -88,6 +110,33 @@ module RuboCop
|
|
88
110
|
|
89
111
|
branches.all? { |branch| branch.body && flow_expression?(branch.body) }
|
90
112
|
end
|
113
|
+
|
114
|
+
def register_redefinition(node)
|
115
|
+
@redefined << node.method_name if redefinable_flow_method? node.method_name
|
116
|
+
false
|
117
|
+
end
|
118
|
+
|
119
|
+
def instance_eval_block?(node)
|
120
|
+
node.block_type? && node.method?(:instance_eval)
|
121
|
+
end
|
122
|
+
|
123
|
+
def report_on_flow_command?(node)
|
124
|
+
return true unless node.send_type?
|
125
|
+
|
126
|
+
# By the contract of this function, this case means that
|
127
|
+
# the method is called on `Kernel` in which case we
|
128
|
+
# always want to report a warning.
|
129
|
+
return true if node.receiver
|
130
|
+
|
131
|
+
# Inside an `instance_eval` we have no way to tell the
|
132
|
+
# type of `self` just by looking at the AST, so we can't
|
133
|
+
# tell if the give function that's called has been
|
134
|
+
# redefined or not, so to avoid false positives, we silence
|
135
|
+
# the warning.
|
136
|
+
return false if @instance_eval_count.positive?
|
137
|
+
|
138
|
+
!@redefined.include? node.method_name
|
139
|
+
end
|
91
140
|
end
|
92
141
|
end
|
93
142
|
end
|
@@ -25,8 +25,12 @@ module RuboCop
|
|
25
25
|
# do_something_else
|
26
26
|
# end
|
27
27
|
class UselessElseWithoutRescue < Base
|
28
|
+
extend TargetRubyVersion
|
29
|
+
|
28
30
|
MSG = '`else` without `rescue` is useless.'
|
29
31
|
|
32
|
+
maximum_target_ruby_version 2.5
|
33
|
+
|
30
34
|
def on_new_investigation
|
31
35
|
processed_source.diagnostics.each do |diagnostic|
|
32
36
|
next unless diagnostic.reason == :useless_else
|
@@ -9,7 +9,7 @@ module RuboCop
|
|
9
9
|
extend NodePattern::Macros
|
10
10
|
include Util
|
11
11
|
|
12
|
-
FOLDABLE_TYPES = %i[array hash heredoc
|
12
|
+
FOLDABLE_TYPES = %i[array hash heredoc method_call].freeze
|
13
13
|
CLASSLIKE_TYPES = %i[class module].freeze
|
14
14
|
private_constant :FOLDABLE_TYPES, :CLASSLIKE_TYPES
|
15
15
|
|
@@ -3,13 +3,13 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Naming
|
6
|
-
#
|
7
|
-
# to both instance and class methods.
|
6
|
+
# Avoid prefixing accessor method names with `get_` or `set_`.
|
7
|
+
# Applies to both instance and class methods.
|
8
8
|
#
|
9
|
-
# NOTE:
|
10
|
-
#
|
11
|
-
#
|
12
|
-
# one.
|
9
|
+
# NOTE: Method names starting with `get_` or `set_` only register an offense
|
10
|
+
# when the methods match the expected arity for getters and setters respectively.
|
11
|
+
# Getters (`get_attribute`) must have no arguments to be registered,
|
12
|
+
# and setters (`set_attribute(value)`) must have exactly one.
|
13
13
|
#
|
14
14
|
# @example
|
15
15
|
# # bad
|
@@ -32,6 +32,7 @@ module RuboCop
|
|
32
32
|
MONUPLE_HASH_MSG =
|
33
33
|
'Delegate hash directly without wrapping in an array when only using a single value.'
|
34
34
|
REDUNDANT_HASH_MSG = 'Calling .hash on elements of a hashed array is redundant.'
|
35
|
+
RESTRICT_ON_SEND = %i[hash ^ + * |].freeze
|
35
36
|
|
36
37
|
# @!method hash_method_definition?(node)
|
37
38
|
def_node_matcher :hash_method_definition?, <<~PATTERN
|
@@ -25,18 +25,19 @@ module RuboCop
|
|
25
25
|
#
|
26
26
|
class YAMLLoad < Base
|
27
27
|
extend AutoCorrector
|
28
|
+
extend TargetRubyVersion
|
28
29
|
|
29
30
|
MSG = 'Prefer using `YAML.safe_load` over `YAML.load`.'
|
30
31
|
RESTRICT_ON_SEND = %i[load].freeze
|
31
32
|
|
33
|
+
maximum_target_ruby_version 3.0
|
34
|
+
|
32
35
|
# @!method yaml_load(node)
|
33
36
|
def_node_matcher :yaml_load, <<~PATTERN
|
34
37
|
(send (const {nil? cbase} :YAML) :load ...)
|
35
38
|
PATTERN
|
36
39
|
|
37
40
|
def on_send(node)
|
38
|
-
return if target_ruby_version >= 3.1
|
39
|
-
|
40
41
|
yaml_load(node) do
|
41
42
|
add_offense(node.loc.selector) do |corrector|
|
42
43
|
corrector.replace(node.loc.selector, 'safe_load')
|
@@ -196,7 +196,7 @@ module RuboCop
|
|
196
196
|
|
197
197
|
def offense?(node)
|
198
198
|
(group_style? && access_modifier_is_inlined?(node) &&
|
199
|
-
!right_siblings_same_inline_method?(node)) ||
|
199
|
+
!node.parent&.if_type? && !right_siblings_same_inline_method?(node)) ||
|
200
200
|
(inline_style? && access_modifier_is_not_inlined?(node))
|
201
201
|
end
|
202
202
|
|
@@ -342,16 +342,23 @@ module RuboCop
|
|
342
342
|
node.respond_to?(:block_node) && node.block_node
|
343
343
|
end
|
344
344
|
|
345
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
345
346
|
def get_blocks(node, &block)
|
346
347
|
case node.type
|
347
348
|
when :block, :numblock
|
348
349
|
yield node
|
349
350
|
when :send
|
351
|
+
# When a method has an argument which is another method with a block,
|
352
|
+
# that block needs braces, otherwise a syntax error will be introduced
|
353
|
+
# for subsequent arguments.
|
354
|
+
# Additionally, even without additional arguments, changing `{...}` to
|
355
|
+
# `do...end` will change the binding of the block to the outer method.
|
350
356
|
get_blocks(node.receiver, &block) if node.receiver
|
357
|
+
node.arguments.each { |argument| get_blocks(argument, &block) }
|
351
358
|
when :hash
|
352
359
|
# A hash which is passed as method argument may have no braces
|
353
360
|
# In that case, one of the K/V pairs could contain a block node
|
354
|
-
# which could change in meaning if do...end replaced {...}
|
361
|
+
# which could change in meaning if `do...end` is replaced with `{...}`
|
355
362
|
return if node.braces?
|
356
363
|
|
357
364
|
node.each_child_node { |child| get_blocks(child, &block) }
|
@@ -359,6 +366,7 @@ module RuboCop
|
|
359
366
|
node.each_child_node { |child| get_blocks(child, &block) }
|
360
367
|
end
|
361
368
|
end
|
369
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
362
370
|
|
363
371
|
# rubocop:disable Metrics/CyclomaticComplexity
|
364
372
|
def proper_block_style?(node)
|
@@ -24,7 +24,6 @@ module RuboCop
|
|
24
24
|
#
|
25
25
|
class DigChain < Base
|
26
26
|
extend AutoCorrector
|
27
|
-
include RangeHelp
|
28
27
|
include CommentsHelp
|
29
28
|
include DigHelp
|
30
29
|
|
@@ -49,17 +48,17 @@ module RuboCop
|
|
49
48
|
# Walk up the method chain while the receiver is `dig` with arguments.
|
50
49
|
def inspect_chain(node)
|
51
50
|
arguments = node.arguments.dup
|
52
|
-
|
51
|
+
end_range = node.source_range.end
|
53
52
|
|
54
|
-
while dig?(
|
55
|
-
|
53
|
+
while dig?(node = node.receiver)
|
54
|
+
begin_range = node.loc.selector
|
56
55
|
arguments.unshift(*node.arguments)
|
57
56
|
ignore_node(node)
|
58
57
|
end
|
59
58
|
|
60
|
-
return unless
|
59
|
+
return unless begin_range
|
61
60
|
|
62
|
-
[
|
61
|
+
[begin_range.join(end_range), arguments]
|
63
62
|
end
|
64
63
|
|
65
64
|
def invalid_arguments?(arguments)
|
@@ -23,10 +23,21 @@ module RuboCop
|
|
23
23
|
# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k == :bar }
|
24
24
|
# {foo: 1, bar: 2, baz: 3}.select {|k, v| k != :bar }
|
25
25
|
# {foo: 1, bar: 2, baz: 3}.filter {|k, v| k != :bar }
|
26
|
+
# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k.eql?(:bar) }
|
27
|
+
#
|
28
|
+
# # bad
|
26
29
|
# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[bar].include?(k) }
|
27
30
|
# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[bar].include?(k) }
|
28
31
|
# {foo: 1, bar: 2, baz: 3}.filter {|k, v| !%i[bar].include?(k) }
|
29
32
|
#
|
33
|
+
# # bad
|
34
|
+
# {foo: 1, bar: 2, baz: 3}.reject {|k, v| !%i[bar].exclude?(k) }
|
35
|
+
# {foo: 1, bar: 2, baz: 3}.select {|k, v| %i[bar].exclude?(k) }
|
36
|
+
#
|
37
|
+
# # bad
|
38
|
+
# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k.in?(%i[bar]) }
|
39
|
+
# {foo: 1, bar: 2, baz: 3}.select {|k, v| !k.in?(%i[bar]) }
|
40
|
+
#
|
30
41
|
# # good
|
31
42
|
# {foo: 1, bar: 2, baz: 3}.except(:bar)
|
32
43
|
#
|
@@ -73,9 +84,8 @@ module RuboCop
|
|
73
84
|
PATTERN
|
74
85
|
|
75
86
|
def on_send(node)
|
76
|
-
method_name = node.method_name
|
77
87
|
block = node.parent
|
78
|
-
return unless bad_method?(
|
88
|
+
return unless bad_method?(block) && semantically_except_method?(node, block)
|
79
89
|
|
80
90
|
except_key = except_key(block)
|
81
91
|
return if except_key.nil? || !safe_to_register_offense?(block, except_key)
|
@@ -92,7 +102,7 @@ module RuboCop
|
|
92
102
|
private
|
93
103
|
|
94
104
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
95
|
-
def bad_method?(
|
105
|
+
def bad_method?(block)
|
96
106
|
if active_support_extensions_enabled?
|
97
107
|
bad_method_with_active_support?(block) do |key_arg, send_node|
|
98
108
|
if send_node.method?(:in?) && send_node.receiver&.source != key_arg.source
|
@@ -104,8 +114,6 @@ module RuboCop
|
|
104
114
|
end
|
105
115
|
else
|
106
116
|
bad_method_with_poro?(block) do |key_arg, send_node|
|
107
|
-
return false if method_name == :reject && block.body.method?(:!)
|
108
|
-
|
109
117
|
!send_node.method?(:include?) || send_node.first_argument&.source == key_arg.source
|
110
118
|
end
|
111
119
|
end
|
@@ -129,11 +137,15 @@ module RuboCop
|
|
129
137
|
end
|
130
138
|
|
131
139
|
def included?(negated, body)
|
132
|
-
|
140
|
+
if negated
|
141
|
+
body.method?('exclude?')
|
142
|
+
else
|
143
|
+
body.method?('include?') || body.method?('in?')
|
144
|
+
end
|
133
145
|
end
|
134
146
|
|
135
147
|
def not_included?(negated, body)
|
136
|
-
|
148
|
+
included?(!negated, body)
|
137
149
|
end
|
138
150
|
|
139
151
|
def safe_to_register_offense?(block, except_key)
|
@@ -44,6 +44,7 @@ module RuboCop
|
|
44
44
|
correct_style_detected
|
45
45
|
end
|
46
46
|
end
|
47
|
+
alias on_csend on_send
|
47
48
|
|
48
49
|
private
|
49
50
|
|
@@ -54,9 +55,10 @@ module RuboCop
|
|
54
55
|
def prefer(node)
|
55
56
|
receiver = node.receiver.source
|
56
57
|
arguments = node.arguments.map(&:source).join(', ')
|
58
|
+
dot = node.loc.dot.source
|
57
59
|
method = explicit_style? ? "call(#{arguments})" : "(#{arguments})"
|
58
60
|
|
59
|
-
"#{receiver}
|
61
|
+
"#{receiver}#{dot}#{method}"
|
60
62
|
end
|
61
63
|
|
62
64
|
def implicit_style?
|
@@ -118,7 +118,9 @@ module RuboCop
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def exclude_cntrl_character?(target_argument, redundant_argument)
|
121
|
-
|
121
|
+
return true unless (target_argument_string = target_argument.to_s).valid_encoding?
|
122
|
+
|
123
|
+
!target_argument_string.sub(/\A'/, '"').sub(/'\z/, '"').match?(/[[:cntrl:]]/) ||
|
122
124
|
!redundant_argument.match?(/[[:cntrl:]]/)
|
123
125
|
end
|
124
126
|
end
|
@@ -142,22 +142,24 @@ module RuboCop
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def replacement(parts)
|
145
|
-
interpolated_parts =
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
else
|
154
|
-
"\#{#{part.source}}"
|
155
|
-
end
|
145
|
+
interpolated_parts = parts.map do |part|
|
146
|
+
case part.type
|
147
|
+
when :str
|
148
|
+
adjust_str(part)
|
149
|
+
when :dstr
|
150
|
+
part.children.all?(&:str_type?) ? adjust_str(part) : contents_range(part).source
|
151
|
+
else
|
152
|
+
"\#{#{part.source}}"
|
156
153
|
end
|
154
|
+
end
|
157
155
|
|
158
156
|
"\"#{handle_quotes(interpolated_parts).join}\""
|
159
157
|
end
|
160
158
|
|
159
|
+
def adjust_str(node)
|
160
|
+
single_quoted?(node) ? node.value.gsub(/(\\|")/, '\\\\\&') : node.value.inspect[1..-2]
|
161
|
+
end
|
162
|
+
|
161
163
|
def handle_quotes(parts)
|
162
164
|
parts.map do |part|
|
163
165
|
part == '"' ? '\"' : part
|
data/lib/rubocop/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.69.
|
4
|
+
version: 1.69.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
8
8
|
- Jonas Arvidsson
|
9
9
|
- Yuji Nakayama
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-12-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
97
|
+
version: 2.9.3
|
98
98
|
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '3.0'
|
@@ -104,7 +104,7 @@ dependencies:
|
|
104
104
|
requirements:
|
105
105
|
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version:
|
107
|
+
version: 2.9.3
|
108
108
|
- - "<"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.0'
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.36.
|
117
|
+
version: 1.36.2
|
118
118
|
- - "<"
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '2.0'
|
@@ -124,7 +124,7 @@ dependencies:
|
|
124
124
|
requirements:
|
125
125
|
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version: 1.36.
|
127
|
+
version: 1.36.2
|
128
128
|
- - "<"
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '2.0'
|
@@ -1035,12 +1035,12 @@ licenses:
|
|
1035
1035
|
- MIT
|
1036
1036
|
metadata:
|
1037
1037
|
homepage_uri: https://rubocop.org/
|
1038
|
-
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.69.
|
1038
|
+
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.69.1
|
1039
1039
|
source_code_uri: https://github.com/rubocop/rubocop/
|
1040
1040
|
documentation_uri: https://docs.rubocop.org/rubocop/1.69/
|
1041
1041
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
1042
1042
|
rubygems_mfa_required: 'true'
|
1043
|
-
post_install_message:
|
1043
|
+
post_install_message:
|
1044
1044
|
rdoc_options: []
|
1045
1045
|
require_paths:
|
1046
1046
|
- lib
|
@@ -1055,8 +1055,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1055
1055
|
- !ruby/object:Gem::Version
|
1056
1056
|
version: '0'
|
1057
1057
|
requirements: []
|
1058
|
-
rubygems_version: 3.
|
1059
|
-
signing_key:
|
1058
|
+
rubygems_version: 3.3.7
|
1059
|
+
signing_key:
|
1060
1060
|
specification_version: 4
|
1061
1061
|
summary: Automatic Ruby code style checking tool.
|
1062
1062
|
test_files: []
|