rubocop 1.44.0 → 1.44.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/layout/closing_parenthesis_indentation.rb +1 -1
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +4 -0
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +1 -0
- data/lib/rubocop/cop/lint/heredoc_method_call_position.rb +15 -17
- data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +1 -0
- data/lib/rubocop/cop/lint/void.rb +2 -0
- data/lib/rubocop/cop/naming/block_forwarding.rb +4 -0
- data/lib/rubocop/cop/style/one_line_conditional.rb +1 -1
- data/lib/rubocop/cop/style/parallel_assignment.rb +3 -1
- data/lib/rubocop/cop/style/self_assignment.rb +2 -2
- data/lib/rubocop/cop/variable_force/variable_table.rb +3 -1
- data/lib/rubocop/rspec/expect_offense.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f6f58220d287e215fa9baaa9c274e89b128c0e42222595caa432132d27de274
|
4
|
+
data.tar.gz: e3c547bef6b2803f80ba22013eae4cff56f6fb572aca19a886bb2fb52e8ba665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9d29df635f00839a5da2cee59c55d4a279129529e3f0b130b7ad8602058fa11e733562a8e253dfa03b45e716c406e425d6c1f28fbd5a4a0b06436404058aa91
|
7
|
+
data.tar.gz: 4a80236cfa9402004dddf72346b395e944840da07525658de1a42ce5bbef7a030be86c38af798e6cf977b75b2c6153ecd7f33b9d91ab3cec1d631b68d21a4568
|
@@ -38,6 +38,10 @@ module RuboCop
|
|
38
38
|
'a whitespace to the right of the `%<operator>s` if it ' \
|
39
39
|
'should be %<possible>s.'
|
40
40
|
|
41
|
+
def self.autocorrect_incompatible_with
|
42
|
+
[Naming::BlockForwarding]
|
43
|
+
end
|
44
|
+
|
41
45
|
def on_new_investigation
|
42
46
|
processed_source.diagnostics.each do |diagnostic|
|
43
47
|
next unless diagnostic.reason == :ambiguous_prefix
|
@@ -80,6 +80,7 @@ module RuboCop
|
|
80
80
|
num_of_format_args, num_of_expected_fields = count_matches(node)
|
81
81
|
|
82
82
|
return false if num_of_format_args == :unknown
|
83
|
+
return false if num_of_expected_fields.zero? && node.child_nodes.first.dstr_type?
|
83
84
|
|
84
85
|
matched_arguments_count?(num_of_expected_fields, num_of_format_args)
|
85
86
|
end
|
@@ -8,27 +8,25 @@ module RuboCop
|
|
8
8
|
#
|
9
9
|
# @example
|
10
10
|
# # bad
|
11
|
+
# <<-SQL
|
12
|
+
# bar
|
13
|
+
# SQL
|
14
|
+
# .strip_indent
|
11
15
|
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
# <<-SQL
|
18
|
-
# bar
|
19
|
-
# SQL
|
20
|
-
# .strip_indent
|
21
|
-
# .trim
|
16
|
+
# <<-SQL
|
17
|
+
# bar
|
18
|
+
# SQL
|
19
|
+
# .strip_indent
|
20
|
+
# .trim
|
22
21
|
#
|
23
22
|
# # good
|
23
|
+
# <<~SQL
|
24
|
+
# bar
|
25
|
+
# SQL
|
24
26
|
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# <<~SQL.trim
|
30
|
-
# bar
|
31
|
-
# SQL
|
27
|
+
# <<~SQL.trim
|
28
|
+
# bar
|
29
|
+
# SQL
|
32
30
|
#
|
33
31
|
class HeredocMethodCallPosition < Base
|
34
32
|
include RangeHelp
|
@@ -68,7 +68,7 @@ module RuboCop
|
|
68
68
|
replaced_node = ternary_replacement(node)
|
69
69
|
|
70
70
|
return replaced_node unless node.parent
|
71
|
-
return "(#{replaced_node})" if
|
71
|
+
return "(#{replaced_node})" if node.parent.operator_keyword?
|
72
72
|
return "(#{replaced_node})" if node.parent.send_type? && node.parent.operator_method?
|
73
73
|
|
74
74
|
replaced_node
|
@@ -172,7 +172,9 @@ module RuboCop
|
|
172
172
|
end
|
173
173
|
|
174
174
|
def modifier_statement?(node)
|
175
|
-
|
175
|
+
return false unless node
|
176
|
+
|
177
|
+
node.basic_conditional? && node.modifier_form?
|
176
178
|
end
|
177
179
|
|
178
180
|
# An internal class for correcting parallel assignment
|
@@ -42,7 +42,7 @@ module RuboCop
|
|
42
42
|
|
43
43
|
if rhs.send_type?
|
44
44
|
check_send_node(node, rhs, var_name, var_type)
|
45
|
-
elsif
|
45
|
+
elsif rhs.operator_keyword?
|
46
46
|
check_boolean_node(node, rhs, var_name, var_type)
|
47
47
|
end
|
48
48
|
end
|
@@ -76,7 +76,7 @@ module RuboCop
|
|
76
76
|
|
77
77
|
if rhs.send_type?
|
78
78
|
autocorrect_send_node(corrector, node, rhs)
|
79
|
-
elsif
|
79
|
+
elsif rhs.operator_keyword?
|
80
80
|
autocorrect_boolean_node(corrector, node, rhs)
|
81
81
|
end
|
82
82
|
end
|
@@ -97,8 +97,10 @@ module RuboCop
|
|
97
97
|
scope_stack.reverse_each do |scope|
|
98
98
|
variable = scope.variables[name]
|
99
99
|
return variable if variable
|
100
|
+
|
100
101
|
# Only block scope allows referencing outer scope variables.
|
101
|
-
|
102
|
+
node = scope.node
|
103
|
+
return nil unless node.block_type? || node.numblock_type?
|
102
104
|
end
|
103
105
|
|
104
106
|
nil
|
@@ -6,7 +6,7 @@ module RuboCop
|
|
6
6
|
#
|
7
7
|
# This mixin makes it easier to specify strict offense expectations
|
8
8
|
# in a declarative and visual fashion. Just type out the code that
|
9
|
-
# should generate
|
9
|
+
# should generate an offense, annotate code by writing '^'s
|
10
10
|
# underneath each character that should be highlighted, and follow
|
11
11
|
# the carets with a string (separated by a space) that is the
|
12
12
|
# message of the offense. You can include multiple offenses in
|
data/lib/rubocop/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.44.
|
4
|
+
version: 1.44.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-01-
|
13
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|