rubocop 1.23.0 → 1.24.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 +45 -1
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +1 -1
- data/lib/rubocop/cli/command/init_dotfile.rb +1 -1
- data/lib/rubocop/cli/command/show_docs_url.rb +48 -0
- data/lib/rubocop/cli/command/suggest_extensions.rb +1 -1
- data/lib/rubocop/cli.rb +1 -0
- data/lib/rubocop/config_loader_resolver.rb +1 -1
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +1 -1
- data/lib/rubocop/cop/correctors/each_to_for_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/if_then_corrector.rb +55 -0
- data/lib/rubocop/cop/documentation.rb +19 -2
- data/lib/rubocop/cop/gemspec/require_mfa.rb +5 -5
- data/lib/rubocop/cop/internal_affairs/redundant_method_dispatch_node.rb +46 -0
- data/lib/rubocop/cop/internal_affairs/undefined_config.rb +3 -1
- data/lib/rubocop/cop/internal_affairs.rb +1 -0
- data/lib/rubocop/cop/layout/comment_indentation.rb +31 -2
- data/lib/rubocop/cop/layout/dot_position.rb +4 -0
- data/lib/rubocop/cop/layout/hash_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/space_after_colon.rb +1 -1
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +4 -0
- data/lib/rubocop/cop/lint/constant_definition_in_block.rb +1 -1
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +16 -4
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +6 -0
- data/lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb +4 -0
- data/lib/rubocop/cop/metrics/block_length.rb +1 -0
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +0 -9
- data/lib/rubocop/cop/metrics/method_length.rb +1 -0
- data/lib/rubocop/cop/metrics/module_length.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +5 -0
- data/lib/rubocop/cop/mixin/hash_alignment_styles.rb +4 -3
- data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +56 -0
- data/lib/rubocop/cop/naming/block_forwarding.rb +102 -0
- data/lib/rubocop/cop/security/open.rb +11 -1
- data/lib/rubocop/cop/style/character_literal.rb +8 -1
- data/lib/rubocop/cop/style/collection_compact.rb +31 -13
- data/lib/rubocop/cop/style/combinable_loops.rb +2 -2
- data/lib/rubocop/cop/style/empty_case_condition.rb +10 -0
- data/lib/rubocop/cop/style/file_read.rb +112 -0
- data/lib/rubocop/cop/style/file_write.rb +98 -0
- data/lib/rubocop/cop/style/hash_conversion.rb +2 -1
- data/lib/rubocop/cop/style/hash_syntax.rb +22 -0
- data/lib/rubocop/cop/style/if_inside_else.rb +15 -0
- data/lib/rubocop/cop/style/map_to_hash.rb +68 -0
- data/lib/rubocop/cop/style/numeric_literals.rb +10 -1
- data/lib/rubocop/cop/style/one_line_conditional.rb +18 -39
- data/lib/rubocop/cop/style/redundant_interpolation.rb +17 -3
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +5 -1
- data/lib/rubocop/cop/style/redundant_self.rb +1 -1
- data/lib/rubocop/cop/style/safe_navigation.rb +1 -5
- data/lib/rubocop/cop/style/single_line_block_params.rb +2 -2
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +3 -1
- data/lib/rubocop/cop/team.rb +1 -1
- data/lib/rubocop/options.rb +6 -1
- data/lib/rubocop/remote_config.rb +1 -3
- data/lib/rubocop/result_cache.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- data/lib/rubocop.rb +7 -0
- metadata +13 -5
@@ -80,11 +80,19 @@ module RuboCop
|
|
80
80
|
private
|
81
81
|
|
82
82
|
def autocorrect(corrector, node)
|
83
|
+
if then?(node)
|
84
|
+
# If the nested `if` is a then node, correct it first,
|
85
|
+
# then the next pass will use `correct_to_elsif_from_if_inside_else_form`
|
86
|
+
IfThenCorrector.new(node, indentation: 0).call(corrector)
|
87
|
+
return
|
88
|
+
end
|
89
|
+
|
83
90
|
if node.modifier_form?
|
84
91
|
correct_to_elsif_from_modifier_form(corrector, node)
|
85
92
|
else
|
86
93
|
correct_to_elsif_from_if_inside_else_form(corrector, node, node.condition)
|
87
94
|
end
|
95
|
+
|
88
96
|
corrector.remove(range_by_whole_lines(find_end_range(node), include_final_newline: true))
|
89
97
|
return unless (if_branch = node.if_branch)
|
90
98
|
|
@@ -102,15 +110,22 @@ module RuboCop
|
|
102
110
|
|
103
111
|
def correct_to_elsif_from_if_inside_else_form(corrector, node, condition)
|
104
112
|
corrector.replace(node.parent.loc.else, "elsif #{condition.source}")
|
113
|
+
|
105
114
|
if_condition_range = if_condition_range(node, condition)
|
115
|
+
|
106
116
|
if (if_branch = node.if_branch)
|
107
117
|
corrector.replace(if_condition_range, if_branch.source)
|
108
118
|
else
|
109
119
|
corrector.remove(range_by_whole_lines(if_condition_range, include_final_newline: true))
|
110
120
|
end
|
121
|
+
|
111
122
|
corrector.remove(condition)
|
112
123
|
end
|
113
124
|
|
125
|
+
def then?(node)
|
126
|
+
node.loc.begin&.source == 'then'
|
127
|
+
end
|
128
|
+
|
114
129
|
def find_end_range(node)
|
115
130
|
end_range = node.loc.end
|
116
131
|
return end_range if end_range
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Style
|
6
|
+
# This cop looks for uses of `map.to_h` or `collect.to_h` that could be
|
7
|
+
# written with just `to_h` in Ruby >= 2.6.
|
8
|
+
#
|
9
|
+
# NOTE: `Style/HashTransformKeys` and `Style/HashTransformValues` will
|
10
|
+
# also change this pattern if only hash keys or hash values are being
|
11
|
+
# transformed.
|
12
|
+
#
|
13
|
+
# @safety
|
14
|
+
# This cop is unsafe, as it can produce false positives if the receiver
|
15
|
+
# is not an `Enumerable`.
|
16
|
+
#
|
17
|
+
# @example
|
18
|
+
# # bad
|
19
|
+
# something.map { |v| [v, v * 2] }.to_h
|
20
|
+
#
|
21
|
+
# # good
|
22
|
+
# something.to_h { |v| [v, v * 2] }
|
23
|
+
#
|
24
|
+
# # bad
|
25
|
+
# {foo: bar}.collect { |k, v| [k.to_s, v.do_something] }.to_h
|
26
|
+
#
|
27
|
+
# # good
|
28
|
+
# {foo: bar}.to_h { |k, v| [k.to_s, v.do_something] }
|
29
|
+
#
|
30
|
+
class MapToHash < Base
|
31
|
+
extend AutoCorrector
|
32
|
+
extend TargetRubyVersion
|
33
|
+
include RangeHelp
|
34
|
+
|
35
|
+
minimum_target_ruby_version 2.6
|
36
|
+
|
37
|
+
MSG = 'Pass a block to `to_h` instead of calling `%<method>s.to_h`.'
|
38
|
+
RESTRICT_ON_SEND = %i[to_h].freeze
|
39
|
+
|
40
|
+
# @!method map_to_h?(node)
|
41
|
+
def_node_matcher :map_to_h?, <<~PATTERN
|
42
|
+
$(send (block $(send _ {:map :collect}) ...) :to_h)
|
43
|
+
PATTERN
|
44
|
+
|
45
|
+
def on_send(node)
|
46
|
+
return unless (to_h_node, map_node = map_to_h?(node))
|
47
|
+
|
48
|
+
message = format(MSG, method: map_node.loc.selector.source)
|
49
|
+
add_offense(map_node.loc.selector, message: message) do |corrector|
|
50
|
+
# If the `to_h` call already has a block, do not auto-correct.
|
51
|
+
next if to_h_node.block_node
|
52
|
+
|
53
|
+
autocorrect(corrector, to_h_node, map_node)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def autocorrect(corrector, to_h, map)
|
60
|
+
removal_range = range_between(to_h.loc.dot.begin_pos, to_h.loc.selector.end_pos)
|
61
|
+
|
62
|
+
corrector.remove(removal_range)
|
63
|
+
corrector.replace(map.loc.selector, 'to_h')
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -27,6 +27,11 @@ module RuboCop
|
|
27
27
|
# # bad
|
28
28
|
# 10_000_00 # typical representation of $10,000 in cents
|
29
29
|
#
|
30
|
+
# @example AllowedNumbers: [3000]
|
31
|
+
#
|
32
|
+
# # good
|
33
|
+
# 3000 # You can specify allowed numbers. (e.g. port number)
|
34
|
+
#
|
30
35
|
class NumericLiterals < Base
|
31
36
|
include IntegerNode
|
32
37
|
extend AutoCorrector
|
@@ -51,9 +56,9 @@ module RuboCop
|
|
51
56
|
|
52
57
|
def check(node)
|
53
58
|
int = integer_part(node)
|
54
|
-
|
55
59
|
# TODO: handle non-decimal literals as well
|
56
60
|
return if int.start_with?('0')
|
61
|
+
return if allowed_numbers.include?(int)
|
57
62
|
return unless int.size >= min_digits
|
58
63
|
|
59
64
|
case int
|
@@ -99,6 +104,10 @@ module RuboCop
|
|
99
104
|
def min_digits
|
100
105
|
cop_config['MinDigits']
|
101
106
|
end
|
107
|
+
|
108
|
+
def allowed_numbers
|
109
|
+
cop_config.fetch('AllowedNumbers', []).map(&:to_s)
|
110
|
+
end
|
102
111
|
end
|
103
112
|
end
|
104
113
|
end
|
@@ -45,7 +45,7 @@ module RuboCop
|
|
45
45
|
|
46
46
|
message = message(node)
|
47
47
|
add_offense(node, message: message) do |corrector|
|
48
|
-
corrector
|
48
|
+
autocorrect(corrector, node)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -55,55 +55,30 @@ module RuboCop
|
|
55
55
|
format(MSG, keyword: node.keyword)
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
58
|
+
def autocorrect(corrector, node)
|
59
59
|
if always_multiline? || cannot_replace_to_ternary?(node)
|
60
|
-
|
60
|
+
IfThenCorrector.new(node, indentation: indentation_width).call(corrector)
|
61
61
|
else
|
62
|
-
|
63
|
-
return replaced_node unless node.parent
|
64
|
-
return "(#{replaced_node})" if %i[and or].include?(node.parent.type)
|
65
|
-
return "(#{replaced_node})" if node.parent.send_type? && node.parent.operator_method?
|
66
|
-
|
67
|
-
replaced_node
|
62
|
+
corrector.replace(node, ternary_correction(node))
|
68
63
|
end
|
69
64
|
end
|
70
65
|
|
71
|
-
def
|
72
|
-
|
73
|
-
end
|
66
|
+
def ternary_correction(node)
|
67
|
+
replaced_node = ternary_replacement(node)
|
74
68
|
|
75
|
-
|
76
|
-
node.
|
77
|
-
|
69
|
+
return replaced_node unless node.parent
|
70
|
+
return "(#{replaced_node})" if %i[and or].include?(node.parent.type)
|
71
|
+
return "(#{replaced_node})" if node.parent.send_type? && node.parent.operator_method?
|
78
72
|
|
79
|
-
|
80
|
-
indentation = ' ' * node.source_range.column if indentation.nil?
|
81
|
-
if_branch_source = node.if_branch&.source || 'nil'
|
82
|
-
elsif_indentation = indentation if node.respond_to?(:elsif?) && node.elsif?
|
83
|
-
if_branch = <<~RUBY
|
84
|
-
#{elsif_indentation}#{node.keyword} #{node.condition.source}
|
85
|
-
#{indentation}#{branch_body_indentation}#{if_branch_source}
|
86
|
-
RUBY
|
87
|
-
else_branch = else_branch_to_multiline(node.else_branch, indentation)
|
88
|
-
if_branch + else_branch
|
73
|
+
replaced_node
|
89
74
|
end
|
90
75
|
|
91
|
-
def
|
92
|
-
|
93
|
-
'end'
|
94
|
-
elsif else_branch.if_type? && else_branch.elsif?
|
95
|
-
multiline_replacement(else_branch, indentation)
|
96
|
-
else
|
97
|
-
<<~RUBY.chomp
|
98
|
-
#{indentation}else
|
99
|
-
#{indentation}#{branch_body_indentation}#{else_branch.source}
|
100
|
-
#{indentation}end
|
101
|
-
RUBY
|
102
|
-
end
|
76
|
+
def always_multiline?
|
77
|
+
@config.for_cop('Style/OneLineConditional')['AlwaysCorrectToMultiline']
|
103
78
|
end
|
104
79
|
|
105
|
-
def
|
106
|
-
|
80
|
+
def cannot_replace_to_ternary?(node)
|
81
|
+
node.elsif_conditional?
|
107
82
|
end
|
108
83
|
|
109
84
|
def ternary_replacement(node)
|
@@ -141,6 +116,10 @@ module RuboCop
|
|
141
116
|
|
142
117
|
node.respond_to?(:arguments?) && node.arguments? && !node.parenthesized_call?
|
143
118
|
end
|
119
|
+
|
120
|
+
def indentation_width
|
121
|
+
@config.for_cop('Layout/IndentationWidth')['Width']
|
122
|
+
end
|
144
123
|
end
|
145
124
|
end
|
146
125
|
end
|
@@ -82,10 +82,20 @@ module RuboCop
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def autocorrect_single_variable_interpolation(corrector, embedded_node, node)
|
85
|
-
|
86
|
-
replacement = "#{variable_loc.expression.source}.to_s"
|
85
|
+
embedded_var = embedded_node.children.first
|
87
86
|
|
88
|
-
|
87
|
+
source = if require_parentheses?(embedded_var)
|
88
|
+
receiver = range_between(
|
89
|
+
embedded_var.loc.expression.begin_pos, embedded_var.loc.selector.end_pos
|
90
|
+
)
|
91
|
+
arguments = embedded_var.arguments.map(&:source).join(', ')
|
92
|
+
|
93
|
+
"#{receiver.source}(#{arguments})"
|
94
|
+
else
|
95
|
+
embedded_var.source
|
96
|
+
end
|
97
|
+
|
98
|
+
corrector.replace(node, "#{source}.to_s")
|
89
99
|
end
|
90
100
|
|
91
101
|
def autocorrect_other(corrector, embedded_node, node)
|
@@ -97,6 +107,10 @@ module RuboCop
|
|
97
107
|
corrector.replace(embedded_loc.begin, '(')
|
98
108
|
corrector.replace(embedded_loc.end, ').to_s')
|
99
109
|
end
|
110
|
+
|
111
|
+
def require_parentheses?(node)
|
112
|
+
node.send_type? && !node.arguments.count.zero? && !node.parenthesized_call?
|
113
|
+
end
|
100
114
|
end
|
101
115
|
end
|
102
116
|
end
|
@@ -80,7 +80,11 @@ module RuboCop
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def without_character_class(loc)
|
83
|
-
loc.source[1..-2]
|
83
|
+
without_character_class = loc.source[1..-2]
|
84
|
+
|
85
|
+
# Adds `\` to prevent auto-correction that changes to an interpolated string when `[#]`.
|
86
|
+
# e.g. From `/[#]{0}/` to `/#{0}/`
|
87
|
+
loc.source == '[#]' ? "\\#{without_character_class}" : without_character_class
|
84
88
|
end
|
85
89
|
|
86
90
|
def whitespace_in_free_space_mode?(node, elem)
|
@@ -218,11 +218,7 @@ module RuboCop
|
|
218
218
|
def find_matching_receiver_invocation(method_chain, checked_variable)
|
219
219
|
return nil unless method_chain
|
220
220
|
|
221
|
-
receiver =
|
222
|
-
method_chain.send_node.receiver
|
223
|
-
else
|
224
|
-
method_chain.receiver
|
225
|
-
end
|
221
|
+
receiver = method_chain.receiver
|
226
222
|
|
227
223
|
return receiver if receiver == checked_variable
|
228
224
|
|
@@ -39,7 +39,7 @@ module RuboCop
|
|
39
39
|
return unless eligible_method?(node)
|
40
40
|
return unless eligible_arguments?(node)
|
41
41
|
|
42
|
-
method_name = node.
|
42
|
+
method_name = node.method_name
|
43
43
|
return if args_match?(method_name, node.arguments)
|
44
44
|
|
45
45
|
preferred_block_arguments = build_preferred_arguments_map(node, target_args(method_name))
|
@@ -81,7 +81,7 @@ module RuboCop
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def eligible_method?(node)
|
84
|
-
node.
|
84
|
+
node.receiver && method_names.include?(node.method_name)
|
85
85
|
end
|
86
86
|
|
87
87
|
def methods
|
@@ -82,7 +82,9 @@ module RuboCop
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def autocorrect(corrector, node, if_branch)
|
85
|
-
|
85
|
+
if node.condition.or_type? || node.condition.assignment?
|
86
|
+
corrector.wrap(node.condition, '(', ')')
|
87
|
+
end
|
86
88
|
|
87
89
|
correct_from_unless_to_if(corrector, node) if node.unless?
|
88
90
|
|
data/lib/rubocop/cop/team.rb
CHANGED
data/lib/rubocop/options.rb
CHANGED
@@ -15,7 +15,7 @@ module RuboCop
|
|
15
15
|
'root of the project. RuboCop will use this path to determine which ' \
|
16
16
|
'cops are enabled (via eg. Include/Exclude), and so that certain cops ' \
|
17
17
|
'like Naming/FileName can be checked.'
|
18
|
-
EXITING_OPTIONS = %i[version verbose_version show_cops].freeze
|
18
|
+
EXITING_OPTIONS = %i[version verbose_version show_cops show_docs_url].freeze
|
19
19
|
DEFAULT_MAXIMUM_EXCLUSION_ITEMS = 15
|
20
20
|
|
21
21
|
def initialize
|
@@ -188,6 +188,9 @@ module RuboCop
|
|
188
188
|
option(opts, '--show-cops [COP1,COP2,...]') do |list|
|
189
189
|
@options[:show_cops] = list.nil? ? [] : list.split(',')
|
190
190
|
end
|
191
|
+
option(opts, '--show-docs-url [COP1,COP2,...]') do |list|
|
192
|
+
@options[:show_docs_url] = list.nil? ? [] : list.split(',')
|
193
|
+
end
|
191
194
|
end
|
192
195
|
end
|
193
196
|
|
@@ -475,6 +478,8 @@ module RuboCop
|
|
475
478
|
show_cops: ['Shows the given cops, or all cops by',
|
476
479
|
'default, and their configurations for the',
|
477
480
|
'current directory.'],
|
481
|
+
show_docs_url: ['Display url to documentation for the given',
|
482
|
+
'cops, or base url by default.'],
|
478
483
|
fail_fast: ['Inspect files in order of modification',
|
479
484
|
'time and stop after the first file',
|
480
485
|
'containing offenses.'],
|
data/lib/rubocop/result_cache.rb
CHANGED
@@ -179,7 +179,7 @@ module RuboCop
|
|
179
179
|
.select { |path| File.file?(path) }
|
180
180
|
.sort!
|
181
181
|
.each do |path|
|
182
|
-
content = File.
|
182
|
+
content = File.binread(path)
|
183
183
|
digest << Zlib.crc32(content).to_s # mtime not reliable
|
184
184
|
end
|
185
185
|
digest << RuboCop::Version::STRING << RuboCop::AST::Version::STRING
|
data/lib/rubocop/version.rb
CHANGED
data/lib/rubocop.rb
CHANGED
@@ -94,6 +94,7 @@ require_relative 'rubocop/cop/mixin/line_length_help'
|
|
94
94
|
require_relative 'rubocop/cop/mixin/match_range'
|
95
95
|
require_relative 'rubocop/cop/metrics/utils/repeated_csend_discount'
|
96
96
|
require_relative 'rubocop/cop/metrics/utils/repeated_attribute_discount'
|
97
|
+
require_relative 'rubocop/cop/mixin/hash_shorthand_syntax'
|
97
98
|
require_relative 'rubocop/cop/mixin/method_complexity'
|
98
99
|
require_relative 'rubocop/cop/mixin/method_preference'
|
99
100
|
require_relative 'rubocop/cop/mixin/min_body_length'
|
@@ -139,6 +140,7 @@ require_relative 'rubocop/cop/correctors/condition_corrector'
|
|
139
140
|
require_relative 'rubocop/cop/correctors/each_to_for_corrector'
|
140
141
|
require_relative 'rubocop/cop/correctors/empty_line_corrector'
|
141
142
|
require_relative 'rubocop/cop/correctors/for_to_each_corrector'
|
143
|
+
require_relative 'rubocop/cop/correctors/if_then_corrector'
|
142
144
|
require_relative 'rubocop/cop/correctors/lambda_literal_to_method_corrector'
|
143
145
|
require_relative 'rubocop/cop/correctors/line_break_corrector'
|
144
146
|
require_relative 'rubocop/cop/correctors/multiline_literal_brace_corrector'
|
@@ -405,6 +407,7 @@ require_relative 'rubocop/cop/metrics/perceived_complexity'
|
|
405
407
|
|
406
408
|
require_relative 'rubocop/cop/naming/accessor_method_name'
|
407
409
|
require_relative 'rubocop/cop/naming/ascii_identifiers'
|
410
|
+
require_relative 'rubocop/cop/naming/block_forwarding'
|
408
411
|
require_relative 'rubocop/cop/naming/block_parameter_name'
|
409
412
|
require_relative 'rubocop/cop/naming/class_and_module_camel_case'
|
410
413
|
require_relative 'rubocop/cop/naming/constant_name'
|
@@ -481,6 +484,8 @@ require_relative 'rubocop/cop/style/even_odd'
|
|
481
484
|
require_relative 'rubocop/cop/style/expand_path_arguments'
|
482
485
|
require_relative 'rubocop/cop/style/explicit_block_argument'
|
483
486
|
require_relative 'rubocop/cop/style/exponential_notation'
|
487
|
+
require_relative 'rubocop/cop/style/file_read'
|
488
|
+
require_relative 'rubocop/cop/style/file_write'
|
484
489
|
require_relative 'rubocop/cop/style/float_division'
|
485
490
|
require_relative 'rubocop/cop/style/for'
|
486
491
|
require_relative 'rubocop/cop/style/format_string'
|
@@ -513,6 +518,7 @@ require_relative 'rubocop/cop/style/keyword_parameters_order'
|
|
513
518
|
require_relative 'rubocop/cop/style/lambda'
|
514
519
|
require_relative 'rubocop/cop/style/lambda_call'
|
515
520
|
require_relative 'rubocop/cop/style/line_end_concatenation'
|
521
|
+
require_relative 'rubocop/cop/style/map_to_hash'
|
516
522
|
require_relative 'rubocop/cop/style/method_call_without_args_parentheses'
|
517
523
|
require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
|
518
524
|
require_relative 'rubocop/cop/style/multiline_in_pattern_then'
|
@@ -705,6 +711,7 @@ require_relative 'rubocop/cli/command/auto_genenerate_config'
|
|
705
711
|
require_relative 'rubocop/cli/command/execute_runner'
|
706
712
|
require_relative 'rubocop/cli/command/init_dotfile'
|
707
713
|
require_relative 'rubocop/cli/command/show_cops'
|
714
|
+
require_relative 'rubocop/cli/command/show_docs_url'
|
708
715
|
require_relative 'rubocop/cli/command/suggest_extensions'
|
709
716
|
require_relative 'rubocop/cli/command/version'
|
710
717
|
require_relative 'rubocop/config_regeneration'
|
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.
|
4
|
+
version: 1.24.0
|
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: 2021-
|
13
|
+
date: 2021-12-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parallel
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.15.0
|
104
104
|
- - "<"
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '2.0'
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: 1.
|
113
|
+
version: 1.15.0
|
114
114
|
- - "<"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '2.0'
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- lib/rubocop/cli/command/execute_runner.rb
|
197
197
|
- lib/rubocop/cli/command/init_dotfile.rb
|
198
198
|
- lib/rubocop/cli/command/show_cops.rb
|
199
|
+
- lib/rubocop/cli/command/show_docs_url.rb
|
199
200
|
- lib/rubocop/cli/command/suggest_extensions.rb
|
200
201
|
- lib/rubocop/cli/command/version.rb
|
201
202
|
- lib/rubocop/cli/environment.rb
|
@@ -233,6 +234,7 @@ files:
|
|
233
234
|
- lib/rubocop/cop/correctors/each_to_for_corrector.rb
|
234
235
|
- lib/rubocop/cop/correctors/empty_line_corrector.rb
|
235
236
|
- lib/rubocop/cop/correctors/for_to_each_corrector.rb
|
237
|
+
- lib/rubocop/cop/correctors/if_then_corrector.rb
|
236
238
|
- lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb
|
237
239
|
- lib/rubocop/cop/correctors/line_break_corrector.rb
|
238
240
|
- lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb
|
@@ -271,6 +273,7 @@ files:
|
|
271
273
|
- lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb
|
272
274
|
- lib/rubocop/cop/internal_affairs/redundant_location_argument.rb
|
273
275
|
- lib/rubocop/cop/internal_affairs/redundant_message_argument.rb
|
276
|
+
- lib/rubocop/cop/internal_affairs/redundant_method_dispatch_node.rb
|
274
277
|
- lib/rubocop/cop/internal_affairs/style_detected_api_use.rb
|
275
278
|
- lib/rubocop/cop/internal_affairs/undefined_config.rb
|
276
279
|
- lib/rubocop/cop/internal_affairs/useless_message_assertion.rb
|
@@ -542,6 +545,7 @@ files:
|
|
542
545
|
- lib/rubocop/cop/mixin/gem_declaration.rb
|
543
546
|
- lib/rubocop/cop/mixin/gemspec_help.rb
|
544
547
|
- lib/rubocop/cop/mixin/hash_alignment_styles.rb
|
548
|
+
- lib/rubocop/cop/mixin/hash_shorthand_syntax.rb
|
545
549
|
- lib/rubocop/cop/mixin/hash_transform_method.rb
|
546
550
|
- lib/rubocop/cop/mixin/heredoc.rb
|
547
551
|
- lib/rubocop/cop/mixin/ignored_methods.rb
|
@@ -587,6 +591,7 @@ files:
|
|
587
591
|
- lib/rubocop/cop/naming/accessor_method_name.rb
|
588
592
|
- lib/rubocop/cop/naming/ascii_identifiers.rb
|
589
593
|
- lib/rubocop/cop/naming/binary_operator_parameter_name.rb
|
594
|
+
- lib/rubocop/cop/naming/block_forwarding.rb
|
590
595
|
- lib/rubocop/cop/naming/block_parameter_name.rb
|
591
596
|
- lib/rubocop/cop/naming/class_and_module_camel_case.rb
|
592
597
|
- lib/rubocop/cop/naming/constant_name.rb
|
@@ -671,6 +676,8 @@ files:
|
|
671
676
|
- lib/rubocop/cop/style/expand_path_arguments.rb
|
672
677
|
- lib/rubocop/cop/style/explicit_block_argument.rb
|
673
678
|
- lib/rubocop/cop/style/exponential_notation.rb
|
679
|
+
- lib/rubocop/cop/style/file_read.rb
|
680
|
+
- lib/rubocop/cop/style/file_write.rb
|
674
681
|
- lib/rubocop/cop/style/float_division.rb
|
675
682
|
- lib/rubocop/cop/style/for.rb
|
676
683
|
- lib/rubocop/cop/style/format_string.rb
|
@@ -703,6 +710,7 @@ files:
|
|
703
710
|
- lib/rubocop/cop/style/lambda.rb
|
704
711
|
- lib/rubocop/cop/style/lambda_call.rb
|
705
712
|
- lib/rubocop/cop/style/line_end_concatenation.rb
|
713
|
+
- lib/rubocop/cop/style/map_to_hash.rb
|
706
714
|
- lib/rubocop/cop/style/method_call_with_args_parentheses.rb
|
707
715
|
- lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb
|
708
716
|
- lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb
|
@@ -903,7 +911,7 @@ metadata:
|
|
903
911
|
homepage_uri: https://rubocop.org/
|
904
912
|
changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
|
905
913
|
source_code_uri: https://github.com/rubocop/rubocop/
|
906
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
914
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.24/
|
907
915
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
908
916
|
rubygems_mfa_required: 'true'
|
909
917
|
post_install_message:
|