rubocop 1.18.4 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/config/default.yml +65 -13
- data/lib/rubocop/cli.rb +18 -0
- data/lib/rubocop/config_loader.rb +2 -2
- data/lib/rubocop/config_loader_resolver.rb +21 -6
- data/lib/rubocop/cop/base.rb +2 -2
- data/lib/rubocop/cop/bundler/gem_filename.rb +103 -0
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +12 -11
- data/lib/rubocop/cop/bundler/ordered_gems.rb +1 -1
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +2 -2
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/require_library_corrector.rb +23 -0
- data/lib/rubocop/cop/documentation.rb +1 -1
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb +34 -0
- data/lib/rubocop/cop/internal_affairs/undefined_config.rb +71 -0
- data/lib/rubocop/cop/internal_affairs.rb +2 -0
- data/lib/rubocop/cop/layout/argument_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/class_structure.rb +2 -1
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +9 -0
- data/lib/rubocop/cop/layout/end_alignment.rb +3 -2
- data/lib/rubocop/cop/layout/hash_alignment.rb +7 -3
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +0 -7
- data/lib/rubocop/cop/layout/leading_comment_space.rb +2 -2
- data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +33 -14
- data/lib/rubocop/cop/layout/line_length.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +3 -0
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +22 -9
- data/lib/rubocop/cop/layout/single_line_block_chain.rb +15 -4
- data/lib/rubocop/cop/layout/space_after_not.rb +1 -0
- data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +2 -1
- data/lib/rubocop/cop/layout/space_around_keyword.rb +2 -2
- data/lib/rubocop/cop/layout/space_around_operators.rb +8 -1
- data/lib/rubocop/cop/layout/space_before_brackets.rb +1 -0
- data/lib/rubocop/cop/layout/space_before_comment.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_parens.rb +5 -5
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +1 -1
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +24 -1
- data/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb +107 -0
- data/lib/rubocop/cop/lint/ambiguous_range.rb +105 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +5 -2
- data/lib/rubocop/cop/lint/debugger.rb +2 -4
- data/lib/rubocop/cop/lint/duplicate_methods.rb +8 -5
- data/lib/rubocop/cop/lint/empty_in_pattern.rb +1 -1
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +1 -1
- data/lib/rubocop/cop/lint/float_out_of_range.rb +1 -1
- data/lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb +67 -0
- data/lib/rubocop/cop/lint/number_conversion.rb +7 -1
- data/lib/rubocop/cop/lint/shadowed_argument.rb +1 -1
- data/lib/rubocop/cop/lint/unused_method_argument.rb +2 -3
- data/lib/rubocop/cop/lint/useless_times.rb +1 -1
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
- data/lib/rubocop/cop/mixin/annotation_comment.rb +57 -34
- data/lib/rubocop/cop/mixin/code_length.rb +1 -1
- data/lib/rubocop/cop/mixin/documentation_comment.rb +5 -2
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +19 -1
- data/lib/rubocop/cop/mixin/heredoc.rb +7 -0
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +2 -2
- data/lib/rubocop/cop/mixin/percent_array.rb +13 -7
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +9 -1
- data/lib/rubocop/cop/mixin/require_library.rb +59 -0
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +1 -1
- data/lib/rubocop/cop/naming/ascii_identifiers.rb +0 -3
- data/lib/rubocop/cop/naming/constant_name.rb +1 -1
- data/lib/rubocop/cop/naming/inclusive_language.rb +27 -10
- data/lib/rubocop/cop/style/accessor_grouping.rb +2 -2
- data/lib/rubocop/cop/style/and_or.rb +4 -0
- data/lib/rubocop/cop/style/ascii_comments.rb +0 -3
- data/lib/rubocop/cop/style/block_delimiters.rb +39 -6
- data/lib/rubocop/cop/style/case_equality.rb +6 -9
- data/lib/rubocop/cop/style/collection_methods.rb +2 -1
- data/lib/rubocop/cop/style/comment_annotation.rb +25 -39
- data/lib/rubocop/cop/style/commented_keyword.rb +2 -1
- data/lib/rubocop/cop/style/conditional_assignment.rb +19 -5
- data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +1 -1
- data/lib/rubocop/cop/style/documentation.rb +23 -8
- data/lib/rubocop/cop/style/double_negation.rb +12 -1
- data/lib/rubocop/cop/style/empty_method.rb +1 -1
- data/lib/rubocop/cop/style/encoding.rb +26 -15
- data/lib/rubocop/cop/style/explicit_block_argument.rb +46 -11
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +1 -1
- data/lib/rubocop/cop/style/hash_as_last_array_item.rb +11 -0
- data/lib/rubocop/cop/style/hash_except.rb +4 -3
- data/lib/rubocop/cop/style/hash_transform_keys.rb +0 -3
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +30 -5
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +3 -2
- data/lib/rubocop/cop/style/lambda_call.rb +1 -1
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +6 -6
- data/lib/rubocop/cop/style/method_def_parentheses.rb +10 -1
- data/lib/rubocop/cop/style/missing_else.rb +7 -0
- data/lib/rubocop/cop/style/mutable_constant.rb +68 -6
- data/lib/rubocop/cop/style/negated_if.rb +1 -1
- data/lib/rubocop/cop/style/negated_unless.rb +1 -1
- data/lib/rubocop/cop/style/non_nil_check.rb +2 -2
- data/lib/rubocop/cop/style/not.rb +2 -2
- data/lib/rubocop/cop/style/parallel_assignment.rb +1 -1
- data/lib/rubocop/cop/style/percent_q_literals.rb +2 -2
- data/lib/rubocop/cop/style/raise_args.rb +1 -1
- data/lib/rubocop/cop/style/redundant_begin.rb +25 -0
- data/lib/rubocop/cop/style/redundant_condition.rb +2 -3
- data/lib/rubocop/cop/style/redundant_freeze.rb +4 -3
- data/lib/rubocop/cop/style/redundant_interpolation.rb +1 -1
- data/lib/rubocop/cop/style/redundant_percent_q.rb +2 -3
- data/lib/rubocop/cop/style/redundant_self_assignment_branch.rb +83 -0
- data/lib/rubocop/cop/style/redundant_sort.rb +19 -4
- data/lib/rubocop/cop/style/regexp_literal.rb +3 -3
- data/lib/rubocop/cop/style/return_nil.rb +2 -1
- data/lib/rubocop/cop/style/semicolon.rb +32 -24
- data/lib/rubocop/cop/style/single_line_block_params.rb +3 -1
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +4 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +21 -0
- data/lib/rubocop/cop/style/static_class.rb +1 -2
- data/lib/rubocop/cop/style/string_concatenation.rb +1 -1
- data/lib/rubocop/cop/style/struct_inheritance.rb +3 -0
- data/lib/rubocop/cop/style/symbol_array.rb +3 -3
- data/lib/rubocop/cop/style/trivial_accessors.rb +1 -1
- data/lib/rubocop/cop/style/word_array.rb +23 -5
- data/lib/rubocop/cop/style/yoda_condition.rb +4 -7
- data/lib/rubocop/cop/util.rb +7 -2
- data/lib/rubocop/magic_comment.rb +44 -15
- data/lib/rubocop/options.rb +1 -1
- data/lib/rubocop/result_cache.rb +1 -1
- data/lib/rubocop/runner.rb +1 -2
- data/lib/rubocop/version.rb +1 -1
- data/lib/rubocop.rb +9 -2
- metadata +14 -5
data/lib/rubocop/cop/util.rb
CHANGED
@@ -46,8 +46,13 @@ module RuboCop
|
|
46
46
|
|
47
47
|
def args_begin(node)
|
48
48
|
loc = node.loc
|
49
|
-
selector =
|
50
|
-
|
49
|
+
selector = if node.super_type? || node.yield_type?
|
50
|
+
loc.keyword
|
51
|
+
elsif node.def_type? || node.defs_type?
|
52
|
+
loc.name
|
53
|
+
else
|
54
|
+
loc.selector
|
55
|
+
end
|
51
56
|
selector.end.resize(1)
|
52
57
|
end
|
53
58
|
|
@@ -7,6 +7,11 @@ module RuboCop
|
|
7
7
|
class MagicComment
|
8
8
|
# @see https://git.io/vMC1C IRB's pattern for matching magic comment tokens
|
9
9
|
TOKEN = /[[:alnum:]\-_]+/.freeze
|
10
|
+
KEYWORDS = {
|
11
|
+
encoding: '(?:en)?coding',
|
12
|
+
frozen_string_literal: 'frozen[_-]string[_-]literal',
|
13
|
+
shareable_constant_value: 'shareable[_-]constant[_-]value'
|
14
|
+
}.freeze
|
10
15
|
|
11
16
|
# Detect magic comment format and pass it to the appropriate wrapper.
|
12
17
|
#
|
@@ -15,8 +20,8 @@ module RuboCop
|
|
15
20
|
# @return [RuboCop::MagicComment]
|
16
21
|
def self.parse(comment)
|
17
22
|
case comment
|
18
|
-
when EmacsComment::
|
19
|
-
when VimComment::
|
23
|
+
when EmacsComment::REGEXP then EmacsComment.new(comment)
|
24
|
+
when VimComment::REGEXP then VimComment.new(comment)
|
20
25
|
else
|
21
26
|
SimpleComment.new(comment)
|
22
27
|
end
|
@@ -30,6 +35,10 @@ module RuboCop
|
|
30
35
|
frozen_string_literal_specified? || encoding_specified? || shareable_constant_value_specified?
|
31
36
|
end
|
32
37
|
|
38
|
+
def valid?
|
39
|
+
@comment.start_with?('#') && any?
|
40
|
+
end
|
41
|
+
|
33
42
|
# Does the magic comment enable the frozen string literal feature.
|
34
43
|
#
|
35
44
|
# Test whether the frozen string literal value is `true`. Cannot
|
@@ -111,6 +120,18 @@ module RuboCop
|
|
111
120
|
#
|
112
121
|
# @abstract
|
113
122
|
class EditorComment < MagicComment
|
123
|
+
def encoding
|
124
|
+
match(self.class::KEYWORDS[:encoding])
|
125
|
+
end
|
126
|
+
|
127
|
+
# Rewrite the comment without a given token type
|
128
|
+
def without(type)
|
129
|
+
remaining = tokens.grep_v(/\A#{self.class::KEYWORDS[type.to_sym]}/)
|
130
|
+
return '' if remaining.empty?
|
131
|
+
|
132
|
+
self.class::FORMAT % remaining.join(self.class::SEPARATOR)
|
133
|
+
end
|
134
|
+
|
114
135
|
private
|
115
136
|
|
116
137
|
# Find a token starting with the provided keyword and extract its value.
|
@@ -135,7 +156,7 @@ module RuboCop
|
|
135
156
|
#
|
136
157
|
# @return [Array<String>]
|
137
158
|
def tokens
|
138
|
-
extract(self.class::
|
159
|
+
extract(self.class::REGEXP).split(self.class::SEPARATOR).map(&:strip)
|
139
160
|
end
|
140
161
|
end
|
141
162
|
|
@@ -151,22 +172,19 @@ module RuboCop
|
|
151
172
|
# @see https://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html
|
152
173
|
# @see https://git.io/vMCXh Emacs handling in Ruby's parse.y
|
153
174
|
class EmacsComment < EditorComment
|
154
|
-
|
175
|
+
REGEXP = /-\*-(.+)-\*-/.freeze
|
176
|
+
FORMAT = '# -*- %s -*-'
|
155
177
|
SEPARATOR = ';'
|
156
178
|
OPERATOR = ':'
|
157
179
|
|
158
|
-
def encoding
|
159
|
-
match('(?:en)?coding')
|
160
|
-
end
|
161
|
-
|
162
180
|
private
|
163
181
|
|
164
182
|
def extract_frozen_string_literal
|
165
|
-
match(
|
183
|
+
match(KEYWORDS[:frozen_string_literal])
|
166
184
|
end
|
167
185
|
|
168
186
|
def extract_shareable_constant_value
|
169
|
-
match(
|
187
|
+
match(KEYWORDS[:shareable_constant_value])
|
170
188
|
end
|
171
189
|
end
|
172
190
|
|
@@ -179,9 +197,11 @@ module RuboCop
|
|
179
197
|
#
|
180
198
|
# comment.encoding # => 'ascii-8bit'
|
181
199
|
class VimComment < EditorComment
|
182
|
-
|
200
|
+
REGEXP = /#\s*vim:\s*(.+)/.freeze
|
201
|
+
FORMAT = '# vim: %s'
|
183
202
|
SEPARATOR = ', '
|
184
203
|
OPERATOR = '='
|
204
|
+
KEYWORDS = MagicComment::KEYWORDS.merge(encoding: 'fileencoding').freeze
|
185
205
|
|
186
206
|
# For some reason the fileencoding keyword only works if there
|
187
207
|
# is at least one other token included in the string. For example
|
@@ -193,7 +213,7 @@ module RuboCop
|
|
193
213
|
# # vim: foo=bar, fileencoding=ascii-8bit
|
194
214
|
#
|
195
215
|
def encoding
|
196
|
-
|
216
|
+
super if tokens.size > 1
|
197
217
|
end
|
198
218
|
|
199
219
|
# Vim comments cannot specify frozen string literal behavior.
|
@@ -219,7 +239,16 @@ module RuboCop
|
|
219
239
|
class SimpleComment < MagicComment
|
220
240
|
# Match `encoding` or `coding`
|
221
241
|
def encoding
|
222
|
-
extract(/\A\s*\#.*\b
|
242
|
+
extract(/\A\s*\#.*\b#{KEYWORDS[:encoding]}: (#{TOKEN})/io)
|
243
|
+
end
|
244
|
+
|
245
|
+
# Rewrite the comment without a given token type
|
246
|
+
def without(type)
|
247
|
+
if @comment.match?(/\A#\s*#{self.class::KEYWORDS[type.to_sym]}/)
|
248
|
+
''
|
249
|
+
else
|
250
|
+
@comment
|
251
|
+
end
|
223
252
|
end
|
224
253
|
|
225
254
|
private
|
@@ -232,11 +261,11 @@ module RuboCop
|
|
232
261
|
# Case-insensitive and dashes/underscores are acceptable.
|
233
262
|
# @see https://git.io/vM7Mg
|
234
263
|
def extract_frozen_string_literal
|
235
|
-
extract(/\A\s*#\s
|
264
|
+
extract(/\A\s*#\s*#{KEYWORDS[:frozen_string_literal]}:\s*(#{TOKEN})\s*\z/io)
|
236
265
|
end
|
237
266
|
|
238
267
|
def extract_shareable_constant_value
|
239
|
-
extract(/\A\s*#\s
|
268
|
+
extract(/\A\s*#\s*#{KEYWORDS[:shareable_constant_value]}:\s*(#{TOKEN})\s*\z/io)
|
240
269
|
end
|
241
270
|
end
|
242
271
|
end
|
data/lib/rubocop/options.rb
CHANGED
@@ -492,7 +492,7 @@ module RuboCop
|
|
492
492
|
version: 'Display version.',
|
493
493
|
verbose_version: 'Display verbose version.',
|
494
494
|
parallel: ['Use available CPUs to execute inspection in',
|
495
|
-
'parallel. Default is
|
495
|
+
'parallel. Default is true.'],
|
496
496
|
stdin: ['Pipe source from STDIN, using FILE in offense',
|
497
497
|
'reports. This is useful for editor integration.'],
|
498
498
|
init: 'Generate a .rubocop.yml file in the current directory.'
|
data/lib/rubocop/result_cache.rb
CHANGED
@@ -45,7 +45,7 @@ module RuboCop
|
|
45
45
|
def remove_oldest_files(files, dirs, cache_root, verbose)
|
46
46
|
# Add 1 to half the number of files, so that we remove the file if
|
47
47
|
# there's only 1 left.
|
48
|
-
remove_count = 1 + files.length / 2
|
48
|
+
remove_count = 1 + (files.length / 2)
|
49
49
|
puts "Removing the #{remove_count} oldest files from #{cache_root}" if verbose
|
50
50
|
sorted = files.sort_by { |path| File.mtime(path) }
|
51
51
|
remove_files(sorted, dirs, remove_count)
|
data/lib/rubocop/runner.rb
CHANGED
@@ -216,8 +216,7 @@ module RuboCop
|
|
216
216
|
def cached_run?
|
217
217
|
@cached_run ||=
|
218
218
|
(@options[:cache] == 'true' ||
|
219
|
-
@options[:cache] != 'false' &&
|
220
|
-
@config_store.for_pwd.for_all_cops['UseCache']) &&
|
219
|
+
(@options[:cache] != 'false' && @config_store.for_pwd.for_all_cops['UseCache'])) &&
|
221
220
|
# When running --auto-gen-config, there's some processing done in the
|
222
221
|
# cops related to calculating the Max parameters for Metrics cops. We
|
223
222
|
# need to do that processing and cannot use caching.
|
data/lib/rubocop/version.rb
CHANGED
data/lib/rubocop.rb
CHANGED
@@ -57,7 +57,6 @@ require_relative 'rubocop/cop/variable_force/reference'
|
|
57
57
|
require_relative 'rubocop/cop/variable_force/scope'
|
58
58
|
require_relative 'rubocop/cop/variable_force/variable_table'
|
59
59
|
|
60
|
-
require_relative 'rubocop/cop/mixin/annotation_comment'
|
61
60
|
require_relative 'rubocop/cop/mixin/array_min_size'
|
62
61
|
require_relative 'rubocop/cop/mixin/array_syntax'
|
63
62
|
require_relative 'rubocop/cop/mixin/alignment'
|
@@ -76,6 +75,7 @@ require_relative 'rubocop/cop/mixin/def_node'
|
|
76
75
|
require_relative 'rubocop/cop/mixin/documentation_comment'
|
77
76
|
require_relative 'rubocop/cop/mixin/duplication'
|
78
77
|
require_relative 'rubocop/cop/mixin/range_help'
|
78
|
+
require_relative 'rubocop/cop/mixin/annotation_comment' # relies on range
|
79
79
|
require_relative 'rubocop/cop/mixin/empty_lines_around_body' # relies on range
|
80
80
|
require_relative 'rubocop/cop/mixin/empty_parameter'
|
81
81
|
require_relative 'rubocop/cop/mixin/end_keyword_alignment'
|
@@ -111,6 +111,7 @@ require_relative 'rubocop/cop/mixin/percent_literal'
|
|
111
111
|
require_relative 'rubocop/cop/mixin/preceding_following_alignment'
|
112
112
|
require_relative 'rubocop/cop/mixin/preferred_delimiters'
|
113
113
|
require_relative 'rubocop/cop/mixin/rational_literal'
|
114
|
+
require_relative 'rubocop/cop/mixin/require_library'
|
114
115
|
require_relative 'rubocop/cop/mixin/rescue_node'
|
115
116
|
require_relative 'rubocop/cop/mixin/safe_assignment'
|
116
117
|
require_relative 'rubocop/cop/mixin/space_after_punctuation'
|
@@ -144,12 +145,14 @@ require_relative 'rubocop/cop/correctors/ordered_gem_corrector'
|
|
144
145
|
require_relative 'rubocop/cop/correctors/parentheses_corrector'
|
145
146
|
require_relative 'rubocop/cop/correctors/percent_literal_corrector'
|
146
147
|
require_relative 'rubocop/cop/correctors/punctuation_corrector'
|
148
|
+
require_relative 'rubocop/cop/correctors/require_library_corrector'
|
147
149
|
require_relative 'rubocop/cop/correctors/space_corrector'
|
148
150
|
require_relative 'rubocop/cop/correctors/string_literal_corrector'
|
149
151
|
require_relative 'rubocop/cop/correctors/unused_arg_corrector'
|
150
152
|
|
151
153
|
require_relative 'rubocop/cop/bundler/duplicated_gem'
|
152
154
|
require_relative 'rubocop/cop/bundler/gem_comment'
|
155
|
+
require_relative 'rubocop/cop/bundler/gem_filename'
|
153
156
|
require_relative 'rubocop/cop/bundler/gem_version'
|
154
157
|
require_relative 'rubocop/cop/bundler/insecure_protocol_source'
|
155
158
|
require_relative 'rubocop/cop/bundler/ordered_gems'
|
@@ -260,6 +263,8 @@ require_relative 'rubocop/cop/layout/trailing_whitespace'
|
|
260
263
|
require_relative 'rubocop/cop/lint/ambiguous_assignment'
|
261
264
|
require_relative 'rubocop/cop/lint/ambiguous_block_association'
|
262
265
|
require_relative 'rubocop/cop/lint/ambiguous_operator'
|
266
|
+
require_relative 'rubocop/cop/lint/ambiguous_operator_precedence'
|
267
|
+
require_relative 'rubocop/cop/lint/ambiguous_range'
|
263
268
|
require_relative 'rubocop/cop/lint/ambiguous_regexp_literal'
|
264
269
|
require_relative 'rubocop/cop/lint/assignment_in_condition'
|
265
270
|
require_relative 'rubocop/cop/lint/big_decimal_new'
|
@@ -302,8 +307,9 @@ require_relative 'rubocop/cop/lint/hash_compare_by_identity'
|
|
302
307
|
require_relative 'rubocop/cop/lint/heredoc_method_call_position'
|
303
308
|
require_relative 'rubocop/cop/lint/identity_comparison'
|
304
309
|
require_relative 'rubocop/cop/lint/implicit_string_concatenation'
|
305
|
-
require_relative 'rubocop/cop/lint/
|
310
|
+
require_relative 'rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler'
|
306
311
|
require_relative 'rubocop/cop/lint/ineffective_access_modifier'
|
312
|
+
require_relative 'rubocop/cop/lint/inherit_exception'
|
307
313
|
require_relative 'rubocop/cop/lint/interpolation_check'
|
308
314
|
require_relative 'rubocop/cop/lint/lambda_without_literal_block'
|
309
315
|
require_relative 'rubocop/cop/lint/literal_as_condition'
|
@@ -510,6 +516,7 @@ require_relative 'rubocop/cop/style/redundant_assignment'
|
|
510
516
|
require_relative 'rubocop/cop/style/redundant_fetch_block'
|
511
517
|
require_relative 'rubocop/cop/style/redundant_file_extension_in_require'
|
512
518
|
require_relative 'rubocop/cop/style/redundant_self_assignment'
|
519
|
+
require_relative 'rubocop/cop/style/redundant_self_assignment_branch'
|
513
520
|
require_relative 'rubocop/cop/style/sole_nested_conditional'
|
514
521
|
require_relative 'rubocop/cop/style/static_class'
|
515
522
|
require_relative 'rubocop/cop/style/method_called_on_do_end_block'
|
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.21.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-09-13 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.9.1
|
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.9.1
|
114
114
|
- - "<"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '2.0'
|
@@ -221,6 +221,7 @@ files:
|
|
221
221
|
- lib/rubocop/cop/base.rb
|
222
222
|
- lib/rubocop/cop/bundler/duplicated_gem.rb
|
223
223
|
- lib/rubocop/cop/bundler/gem_comment.rb
|
224
|
+
- lib/rubocop/cop/bundler/gem_filename.rb
|
224
225
|
- lib/rubocop/cop/bundler/gem_version.rb
|
225
226
|
- lib/rubocop/cop/bundler/insecure_protocol_source.rb
|
226
227
|
- lib/rubocop/cop/bundler/ordered_gems.rb
|
@@ -239,6 +240,7 @@ files:
|
|
239
240
|
- lib/rubocop/cop/correctors/parentheses_corrector.rb
|
240
241
|
- lib/rubocop/cop/correctors/percent_literal_corrector.rb
|
241
242
|
- lib/rubocop/cop/correctors/punctuation_corrector.rb
|
243
|
+
- lib/rubocop/cop/correctors/require_library_corrector.rb
|
242
244
|
- lib/rubocop/cop/correctors/space_corrector.rb
|
243
245
|
- lib/rubocop/cop/correctors/string_literal_corrector.rb
|
244
246
|
- lib/rubocop/cop/correctors/unused_arg_corrector.rb
|
@@ -257,6 +259,7 @@ files:
|
|
257
259
|
- lib/rubocop/cop/internal_affairs.rb
|
258
260
|
- lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb
|
259
261
|
- lib/rubocop/cop/internal_affairs/example_description.rb
|
262
|
+
- lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb
|
260
263
|
- lib/rubocop/cop/internal_affairs/method_name_equal.rb
|
261
264
|
- lib/rubocop/cop/internal_affairs/node_destructuring.rb
|
262
265
|
- lib/rubocop/cop/internal_affairs/node_matcher_directive.rb
|
@@ -267,6 +270,7 @@ files:
|
|
267
270
|
- lib/rubocop/cop/internal_affairs/redundant_location_argument.rb
|
268
271
|
- lib/rubocop/cop/internal_affairs/redundant_message_argument.rb
|
269
272
|
- lib/rubocop/cop/internal_affairs/style_detected_api_use.rb
|
273
|
+
- lib/rubocop/cop/internal_affairs/undefined_config.rb
|
270
274
|
- lib/rubocop/cop/internal_affairs/useless_message_assertion.rb
|
271
275
|
- lib/rubocop/cop/layout/access_modifier_indentation.rb
|
272
276
|
- lib/rubocop/cop/layout/argument_alignment.rb
|
@@ -369,6 +373,8 @@ files:
|
|
369
373
|
- lib/rubocop/cop/lint/ambiguous_assignment.rb
|
370
374
|
- lib/rubocop/cop/lint/ambiguous_block_association.rb
|
371
375
|
- lib/rubocop/cop/lint/ambiguous_operator.rb
|
376
|
+
- lib/rubocop/cop/lint/ambiguous_operator_precedence.rb
|
377
|
+
- lib/rubocop/cop/lint/ambiguous_range.rb
|
372
378
|
- lib/rubocop/cop/lint/ambiguous_regexp_literal.rb
|
373
379
|
- lib/rubocop/cop/lint/assignment_in_condition.rb
|
374
380
|
- lib/rubocop/cop/lint/big_decimal_new.rb
|
@@ -411,6 +417,7 @@ files:
|
|
411
417
|
- lib/rubocop/cop/lint/heredoc_method_call_position.rb
|
412
418
|
- lib/rubocop/cop/lint/identity_comparison.rb
|
413
419
|
- lib/rubocop/cop/lint/implicit_string_concatenation.rb
|
420
|
+
- lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb
|
414
421
|
- lib/rubocop/cop/lint/ineffective_access_modifier.rb
|
415
422
|
- lib/rubocop/cop/lint/inherit_exception.rb
|
416
423
|
- lib/rubocop/cop/lint/interpolation_check.rb
|
@@ -556,6 +563,7 @@ files:
|
|
556
563
|
- lib/rubocop/cop/mixin/preferred_delimiters.rb
|
557
564
|
- lib/rubocop/cop/mixin/range_help.rb
|
558
565
|
- lib/rubocop/cop/mixin/rational_literal.rb
|
566
|
+
- lib/rubocop/cop/mixin/require_library.rb
|
559
567
|
- lib/rubocop/cop/mixin/rescue_node.rb
|
560
568
|
- lib/rubocop/cop/mixin/safe_assignment.rb
|
561
569
|
- lib/rubocop/cop/mixin/space_after_punctuation.rb
|
@@ -759,6 +767,7 @@ files:
|
|
759
767
|
- lib/rubocop/cop/style/redundant_return.rb
|
760
768
|
- lib/rubocop/cop/style/redundant_self.rb
|
761
769
|
- lib/rubocop/cop/style/redundant_self_assignment.rb
|
770
|
+
- lib/rubocop/cop/style/redundant_self_assignment_branch.rb
|
762
771
|
- lib/rubocop/cop/style/redundant_sort.rb
|
763
772
|
- lib/rubocop/cop/style/redundant_sort_by.rb
|
764
773
|
- lib/rubocop/cop/style/regexp_literal.rb
|
@@ -883,7 +892,7 @@ metadata:
|
|
883
892
|
homepage_uri: https://rubocop.org/
|
884
893
|
changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
|
885
894
|
source_code_uri: https://github.com/rubocop/rubocop/
|
886
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
895
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.21/
|
887
896
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
888
897
|
post_install_message:
|
889
898
|
rdoc_options: []
|