rubocop 1.36.0 → 1.38.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 +27 -1
- data/lib/rubocop/arguments_env.rb +17 -0
- data/lib/rubocop/arguments_file.rb +17 -0
- data/lib/rubocop/cli/command/execute_runner.rb +7 -7
- data/lib/rubocop/cli/command/suggest_extensions.rb +8 -1
- data/lib/rubocop/comment_config.rb +36 -1
- data/lib/rubocop/cop/commissioner.rb +3 -1
- data/lib/rubocop/cop/generator.rb +1 -2
- data/lib/rubocop/cop/internal_affairs/create_empty_file.rb +37 -0
- data/lib/rubocop/cop/internal_affairs/example_heredoc_delimiter.rb +111 -0
- data/lib/rubocop/cop/internal_affairs.rb +2 -0
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +1 -0
- data/lib/rubocop/cop/layout/indentation_style.rb +1 -1
- data/lib/rubocop/cop/layout/indentation_width.rb +1 -1
- data/lib/rubocop/cop/layout/line_continuation_spacing.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +13 -9
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +30 -3
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +6 -2
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +1 -1
- data/lib/rubocop/cop/lint/duplicate_magic_comment.rb +73 -0
- data/lib/rubocop/cop/lint/duplicate_methods.rb +11 -1
- data/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +25 -6
- data/lib/rubocop/cop/lint/empty_class.rb +3 -1
- data/lib/rubocop/cop/lint/empty_conditional_body.rb +20 -8
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +18 -3
- data/lib/rubocop/cop/lint/nested_method_definition.rb +50 -1
- data/lib/rubocop/cop/lint/number_conversion.rb +1 -1
- data/lib/rubocop/cop/lint/ordered_magic_comments.rb +4 -5
- data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +23 -1
- data/lib/rubocop/cop/lint/redundant_dir_glob_sort.rb +7 -0
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +38 -10
- data/lib/rubocop/cop/lint/require_parentheses.rb +1 -1
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +3 -2
- data/lib/rubocop/cop/lint/shadowed_exception.rb +0 -10
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +3 -0
- data/lib/rubocop/cop/lint/unreachable_loop.rb +1 -1
- data/lib/rubocop/cop/lint/unused_method_argument.rb +4 -0
- data/lib/rubocop/cop/mixin/comments_help.rb +12 -0
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +4 -0
- data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +6 -3
- data/lib/rubocop/cop/mixin/rescue_node.rb +3 -1
- data/lib/rubocop/cop/mixin/surrounding_space.rb +10 -8
- data/lib/rubocop/cop/naming/inclusive_language.rb +1 -1
- data/lib/rubocop/cop/registry.rb +10 -4
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +24 -2
- data/lib/rubocop/cop/style/accessor_grouping.rb +7 -3
- data/lib/rubocop/cop/style/block_delimiters.rb +2 -2
- data/lib/rubocop/cop/style/character_literal.rb +1 -1
- data/lib/rubocop/cop/style/class_equality_comparison.rb +1 -1
- data/lib/rubocop/cop/style/collection_compact.rb +11 -2
- data/lib/rubocop/cop/style/empty_method.rb +1 -1
- data/lib/rubocop/cop/style/endless_method.rb +1 -1
- data/lib/rubocop/cop/style/explicit_block_argument.rb +4 -0
- data/lib/rubocop/cop/style/format_string_token.rb +1 -1
- data/lib/rubocop/cop/style/guard_clause.rb +62 -21
- data/lib/rubocop/cop/style/hash_syntax.rb +1 -1
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +25 -2
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +13 -2
- data/lib/rubocop/cop/style/module_function.rb +28 -6
- data/lib/rubocop/cop/style/negated_if_else_condition.rb +7 -1
- data/lib/rubocop/cop/style/numeric_predicate.rb +1 -1
- data/lib/rubocop/cop/style/operator_method_call.rb +40 -0
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -0
- data/lib/rubocop/cop/style/redundant_condition.rb +5 -2
- data/lib/rubocop/cop/style/redundant_each.rb +111 -0
- data/lib/rubocop/cop/style/redundant_initialize.rb +3 -1
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +8 -1
- data/lib/rubocop/cop/style/redundant_string_escape.rb +181 -0
- data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
- data/lib/rubocop/cop/style/static_class.rb +32 -1
- data/lib/rubocop/cop/style/symbol_array.rb +2 -0
- data/lib/rubocop/cop/style/symbol_proc.rb +1 -1
- data/lib/rubocop/cop/style/word_array.rb +2 -0
- data/lib/rubocop/cop/team.rb +3 -4
- data/lib/rubocop/cop/variable_force/variable_table.rb +1 -1
- data/lib/rubocop/cops_documentation_generator.rb +4 -2
- data/lib/rubocop/ext/processed_source.rb +2 -0
- data/lib/rubocop/formatter/disabled_config_formatter.rb +8 -2
- data/lib/rubocop/formatter/offense_count_formatter.rb +8 -5
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +6 -3
- data/lib/rubocop/options.rb +19 -15
- data/lib/rubocop/rspec/cop_helper.rb +21 -1
- data/lib/rubocop/rspec/shared_contexts.rb +14 -1
- data/lib/rubocop/runner.rb +15 -11
- data/lib/rubocop/server/cache.rb +5 -1
- data/lib/rubocop/server/cli.rb +9 -2
- data/lib/rubocop/server/client_command/exec.rb +5 -0
- data/lib/rubocop/server/core.rb +3 -1
- data/lib/rubocop/server/socket_reader.rb +5 -1
- data/lib/rubocop/server.rb +1 -1
- data/lib/rubocop/version.rb +8 -3
- data/lib/rubocop.rb +4 -0
- metadata +13 -5
data/lib/rubocop/options.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'optparse'
|
4
|
-
|
4
|
+
require_relative 'arguments_env'
|
5
|
+
require_relative 'arguments_file'
|
5
6
|
|
6
7
|
module RuboCop
|
7
8
|
class IncorrectCopNameError < StandardError; end
|
@@ -24,7 +25,10 @@ module RuboCop
|
|
24
25
|
end
|
25
26
|
|
26
27
|
def parse(command_line_args)
|
28
|
+
args_from_file = ArgumentsFile.read_as_arguments
|
29
|
+
args_from_env = ArgumentsEnv.read_as_arguments
|
27
30
|
args = args_from_file.concat(args_from_env).concat(command_line_args)
|
31
|
+
|
28
32
|
define_options.parse!(args)
|
29
33
|
|
30
34
|
@validator.validate_compatibility
|
@@ -45,18 +49,6 @@ module RuboCop
|
|
45
49
|
|
46
50
|
private
|
47
51
|
|
48
|
-
def args_from_file
|
49
|
-
if File.exist?('.rubocop') && !File.directory?('.rubocop')
|
50
|
-
File.read('.rubocop').shellsplit
|
51
|
-
else
|
52
|
-
[]
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def args_from_env
|
57
|
-
Shellwords.split(ENV.fetch('RUBOCOP_OPTS', ''))
|
58
|
-
end
|
59
|
-
|
60
52
|
def define_options
|
61
53
|
OptionParser.new do |opts|
|
62
54
|
opts.banner = rainbow.wrap('Usage: rubocop [options] [file1, file2, ...]').bright
|
@@ -73,7 +65,7 @@ module RuboCop
|
|
73
65
|
end
|
74
66
|
|
75
67
|
def add_check_options(opts) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
76
|
-
section(opts, 'Basic Options') do
|
68
|
+
section(opts, 'Basic Options') do # rubocop:disable Metrics/BlockLength
|
77
69
|
option(opts, '-l', '--lint') do
|
78
70
|
@options[:only] ||= []
|
79
71
|
@options[:only] << 'Lint'
|
@@ -98,6 +90,7 @@ module RuboCop
|
|
98
90
|
option(opts, '--force-default-config')
|
99
91
|
option(opts, '-s', '--stdin FILE')
|
100
92
|
option(opts, '-P', '--[no-]parallel')
|
93
|
+
option(opts, '--raise-cop-error')
|
101
94
|
add_severity_option(opts)
|
102
95
|
end
|
103
96
|
end
|
@@ -169,6 +162,7 @@ module RuboCop
|
|
169
162
|
end
|
170
163
|
|
171
164
|
option(opts, '--exclude-limit COUNT') { @validator.validate_exclude_limit_option }
|
165
|
+
option(opts, '--no-exclude-limit')
|
172
166
|
|
173
167
|
option(opts, '--[no-]offense-counts')
|
174
168
|
option(opts, '--[no-]auto-gen-only-exclude')
|
@@ -400,6 +394,12 @@ module RuboCop
|
|
400
394
|
end
|
401
395
|
|
402
396
|
def validate_autocorrect
|
397
|
+
if @options.key?(:safe_autocorrect) && @options.key?(:autocorrect_all)
|
398
|
+
message = Rainbow(<<~MESSAGE).red
|
399
|
+
Error: Both safe and unsafe autocorrect options are specified, use only one.
|
400
|
+
MESSAGE
|
401
|
+
raise OptionArgumentError, message
|
402
|
+
end
|
403
403
|
return if @options.key?(:autocorrect)
|
404
404
|
return unless @options.key?(:disable_uncorrectable)
|
405
405
|
|
@@ -497,6 +497,7 @@ module RuboCop
|
|
497
497
|
disable_uncorrectable: ['Used with --autocorrect to annotate any',
|
498
498
|
'offenses that do not support autocorrect',
|
499
499
|
'with `rubocop:todo` comments.'],
|
500
|
+
no_exclude_limit: ['Do not set the limit for how many files to exclude.'],
|
500
501
|
force_exclusion: ['Any files excluded by `Exclude` in configuration',
|
501
502
|
'files will be excluded, even if given explicitly',
|
502
503
|
'as arguments.'],
|
@@ -589,7 +590,10 @@ module RuboCop
|
|
589
590
|
restart_server: 'Restart server process.',
|
590
591
|
start_server: 'Start server process.',
|
591
592
|
stop_server: 'Stop server process.',
|
592
|
-
server_status: 'Show server status.'
|
593
|
+
server_status: 'Show server status.',
|
594
|
+
raise_cop_error: ['Raise cop-related errors with cause and location.',
|
595
|
+
'This is used to prevent cops from failing silently.',
|
596
|
+
'Default is false.']
|
593
597
|
}.freeze
|
594
598
|
end
|
595
599
|
end
|
@@ -28,7 +28,27 @@ module CopHelper
|
|
28
28
|
file = file.path
|
29
29
|
end
|
30
30
|
|
31
|
-
RuboCop::ProcessedSource.new(source, ruby_version, file)
|
31
|
+
processed_source = RuboCop::ProcessedSource.new(source, ruby_version, file)
|
32
|
+
processed_source.config = configuration
|
33
|
+
processed_source.registry = registry
|
34
|
+
processed_source
|
35
|
+
end
|
36
|
+
|
37
|
+
def configuration
|
38
|
+
@configuration ||= if defined?(config)
|
39
|
+
config
|
40
|
+
else
|
41
|
+
RuboCop::Config.new({}, "#{Dir.pwd}/.rubocop.yml")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def registry
|
46
|
+
@registry ||= begin
|
47
|
+
cops = configuration.keys.map { |cop| RuboCop::Cop::Registry.global.find_by_cop_name(cop) }
|
48
|
+
cops << cop_class if defined?(cop_class) && !cops.include?(cop_class)
|
49
|
+
cops.compact!
|
50
|
+
RuboCop::Cop::Registry.new(cops)
|
51
|
+
end
|
32
52
|
end
|
33
53
|
|
34
54
|
def autocorrect_source_file(source)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'tmpdir'
|
4
4
|
|
5
|
-
RSpec.shared_context 'isolated environment' do
|
5
|
+
RSpec.shared_context 'isolated environment' do # rubocop:disable Metrics/BlockLength
|
6
6
|
around do |example|
|
7
7
|
Dir.mktmpdir do |tmpdir|
|
8
8
|
original_home = Dir.home
|
@@ -36,6 +36,19 @@ RSpec.shared_context 'isolated environment' do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
40
|
+
if RuboCop.const_defined?(:Server)
|
41
|
+
around do |example|
|
42
|
+
RuboCop::Server::Cache.cache_root_path = nil
|
43
|
+
RuboCop::Server::Cache.instance_variable_set(:@project_dir_cache_key, nil)
|
44
|
+
begin
|
45
|
+
example.run
|
46
|
+
ensure
|
47
|
+
RuboCop::Server::Cache.cache_root_path = nil
|
48
|
+
RuboCop::Server::Cache.instance_variable_set(:@project_dir_cache_key, nil)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
39
52
|
end
|
40
53
|
|
41
54
|
RSpec.shared_context 'maintain registry' do
|
data/lib/rubocop/runner.rb
CHANGED
@@ -423,17 +423,21 @@ module RuboCop
|
|
423
423
|
end
|
424
424
|
|
425
425
|
def get_processed_source(file)
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
426
|
+
config = @config_store.for_file(file)
|
427
|
+
ruby_version = config.target_ruby_version
|
428
|
+
|
429
|
+
processed_source = if @options[:stdin]
|
430
|
+
ProcessedSource.new(@options[:stdin], ruby_version, file)
|
431
|
+
else
|
432
|
+
begin
|
433
|
+
ProcessedSource.from_file(file, ruby_version)
|
434
|
+
rescue Errno::ENOENT
|
435
|
+
raise RuboCop::Error, "No such file or directory: #{file}"
|
436
|
+
end
|
437
|
+
end
|
438
|
+
processed_source.config = config
|
439
|
+
processed_source.registry = mobilized_cop_classes(config)
|
440
|
+
processed_source
|
437
441
|
end
|
438
442
|
|
439
443
|
# A Cop::Team instance is stateful and may change when inspecting.
|
data/lib/rubocop/server/cache.rb
CHANGED
@@ -103,9 +103,13 @@ module RuboCop
|
|
103
103
|
dir.join('version')
|
104
104
|
end
|
105
105
|
|
106
|
+
def stderr_path
|
107
|
+
dir.join('stderr')
|
108
|
+
end
|
109
|
+
|
106
110
|
def pid_running?
|
107
111
|
Process.kill(0, pid_path.read.to_i) == 1
|
108
|
-
rescue Errno::ESRCH
|
112
|
+
rescue Errno::ESRCH, Errno::ENOENT
|
109
113
|
false
|
110
114
|
end
|
111
115
|
|
data/lib/rubocop/server/cli.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rainbow'
|
4
|
+
require_relative '../arguments_env'
|
5
|
+
require_relative '../arguments_file'
|
4
6
|
|
5
7
|
#
|
6
8
|
# This code is based on https://github.com/fohte/rubocop-daemon.
|
@@ -29,7 +31,7 @@ module RuboCop
|
|
29
31
|
@exit = false
|
30
32
|
end
|
31
33
|
|
32
|
-
# rubocop:disable Metrics/MethodLength
|
34
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
33
35
|
def run(argv = ARGV)
|
34
36
|
unless Server.support_server?
|
35
37
|
return error('RuboCop server is not supported by this Ruby.') if use_server_option?(argv)
|
@@ -50,11 +52,16 @@ module RuboCop
|
|
50
52
|
return error("#{server_command} cannot be combined with other options.")
|
51
53
|
end
|
52
54
|
|
55
|
+
if server_command.nil?
|
56
|
+
server_command = ArgumentsEnv.read_as_arguments.delete('--server') ||
|
57
|
+
ArgumentsFile.read_as_arguments.delete('--server')
|
58
|
+
end
|
59
|
+
|
53
60
|
run_command(server_command)
|
54
61
|
|
55
62
|
STATUS_SUCCESS
|
56
63
|
end
|
57
|
-
# rubocop:enable Metrics/MethodLength
|
64
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
58
65
|
|
59
66
|
def exit?
|
60
67
|
@exit
|
@@ -23,6 +23,7 @@ module RuboCop
|
|
23
23
|
args: ARGV.dup,
|
24
24
|
body: $stdin.tty? ? '' : $stdin.read
|
25
25
|
)
|
26
|
+
warn stderr unless stderr.empty?
|
26
27
|
status
|
27
28
|
end
|
28
29
|
|
@@ -43,6 +44,10 @@ module RuboCop
|
|
43
44
|
RuboCop::Version::STRING != Cache.version_path.read
|
44
45
|
end
|
45
46
|
|
47
|
+
def stderr
|
48
|
+
Cache.stderr_path.read
|
49
|
+
end
|
50
|
+
|
46
51
|
def status
|
47
52
|
unless Cache.status_path.file?
|
48
53
|
raise "RuboCop server: Could not find status file at: #{Cache.status_path}"
|
data/lib/rubocop/server/core.rb
CHANGED
@@ -41,6 +41,7 @@ module RuboCop
|
|
41
41
|
|
42
42
|
pid = fork do
|
43
43
|
Process.daemon(true)
|
44
|
+
$stderr.reopen(Cache.stderr_path, 'w')
|
44
45
|
Cache.write_pid_file do
|
45
46
|
read_socket(@server.accept) until @server.closed?
|
46
47
|
end
|
@@ -56,7 +57,8 @@ module RuboCop
|
|
56
57
|
def start_server(host, port)
|
57
58
|
@server = TCPServer.open(host, port)
|
58
59
|
|
59
|
-
|
60
|
+
output_stream = ARGV.include?('--stderr') ? $stderr : $stdout
|
61
|
+
output_stream.puts "RuboCop server starting on #{@server.addr[3]}:#{@server.addr[1]}."
|
60
62
|
end
|
61
63
|
|
62
64
|
def read_socket(socket)
|
@@ -24,13 +24,17 @@ module RuboCop
|
|
24
24
|
def read!
|
25
25
|
request = parse_request(@socket.read)
|
26
26
|
|
27
|
+
stderr = StringIO.new
|
27
28
|
Helper.redirect(
|
28
29
|
stdin: StringIO.new(request.body),
|
29
30
|
stdout: @socket,
|
30
|
-
stderr:
|
31
|
+
stderr: stderr
|
31
32
|
) do
|
32
33
|
create_command_instance(request).run
|
33
34
|
end
|
35
|
+
ensure
|
36
|
+
Cache.stderr_path.write(stderr.string)
|
37
|
+
@socket.close
|
34
38
|
end
|
35
39
|
|
36
40
|
private
|
data/lib/rubocop/server.rb
CHANGED
data/lib/rubocop/version.rb
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
module RuboCop
|
4
4
|
# This module holds the RuboCop version information.
|
5
5
|
module Version
|
6
|
-
STRING = '1.
|
6
|
+
STRING = '1.38.0'
|
7
7
|
|
8
8
|
MSG = '%<version>s (using Parser %<parser_version>s, ' \
|
9
9
|
'rubocop-ast %<rubocop_ast_version>s, ' \
|
10
|
-
'running on %<ruby_engine>s %<ruby_version>s)%<
|
10
|
+
'running on %<ruby_engine>s %<ruby_version>s)%<server_mode>s [%<ruby_platform>s]'
|
11
11
|
|
12
12
|
CANONICAL_FEATURE_NAMES = { 'Rspec' => 'RSpec', 'Graphql' => 'GraphQL', 'Md' => 'Markdown',
|
13
13
|
'Thread_safety' => 'ThreadSafety' }.freeze
|
@@ -19,7 +19,7 @@ module RuboCop
|
|
19
19
|
verbose_version = format(MSG, version: STRING, parser_version: Parser::VERSION,
|
20
20
|
rubocop_ast_version: RuboCop::AST::Version::STRING,
|
21
21
|
ruby_engine: RUBY_ENGINE, ruby_version: RUBY_VERSION,
|
22
|
-
|
22
|
+
server_mode: server_mode,
|
23
23
|
ruby_platform: RUBY_PLATFORM)
|
24
24
|
return verbose_version unless env
|
25
25
|
|
@@ -89,5 +89,10 @@ module RuboCop
|
|
89
89
|
def self.document_version
|
90
90
|
STRING.match('\d+\.\d+').to_s
|
91
91
|
end
|
92
|
+
|
93
|
+
# @api private
|
94
|
+
def self.server_mode
|
95
|
+
RuboCop.const_defined?(:Server) && Server.running? ? ' +server' : ''
|
96
|
+
end
|
92
97
|
end
|
93
98
|
end
|
data/lib/rubocop.rb
CHANGED
@@ -292,6 +292,7 @@ require_relative 'rubocop/cop/lint/duplicate_branch'
|
|
292
292
|
require_relative 'rubocop/cop/lint/duplicate_case_condition'
|
293
293
|
require_relative 'rubocop/cop/lint/duplicate_elsif_condition'
|
294
294
|
require_relative 'rubocop/cop/lint/duplicate_hash_key'
|
295
|
+
require_relative 'rubocop/cop/lint/duplicate_magic_comment'
|
295
296
|
require_relative 'rubocop/cop/lint/duplicate_methods'
|
296
297
|
require_relative 'rubocop/cop/lint/duplicate_regexp_character_class_element'
|
297
298
|
require_relative 'rubocop/cop/lint/duplicate_require'
|
@@ -537,7 +538,9 @@ require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
|
|
537
538
|
require_relative 'rubocop/cop/style/multiline_in_pattern_then'
|
538
539
|
require_relative 'rubocop/cop/style/numbered_parameters'
|
539
540
|
require_relative 'rubocop/cop/style/open_struct_use'
|
541
|
+
require_relative 'rubocop/cop/style/operator_method_call'
|
540
542
|
require_relative 'rubocop/cop/style/redundant_assignment'
|
543
|
+
require_relative 'rubocop/cop/style/redundant_each'
|
541
544
|
require_relative 'rubocop/cop/style/redundant_fetch_block'
|
542
545
|
require_relative 'rubocop/cop/style/redundant_file_extension_in_require'
|
543
546
|
require_relative 'rubocop/cop/style/redundant_initialize'
|
@@ -612,6 +615,7 @@ require_relative 'rubocop/cop/style/redundant_return'
|
|
612
615
|
require_relative 'rubocop/cop/style/redundant_self'
|
613
616
|
require_relative 'rubocop/cop/style/redundant_sort'
|
614
617
|
require_relative 'rubocop/cop/style/redundant_sort_by'
|
618
|
+
require_relative 'rubocop/cop/style/redundant_string_escape'
|
615
619
|
require_relative 'rubocop/cop/style/regexp_literal'
|
616
620
|
require_relative 'rubocop/cop/style/rescue_modifier'
|
617
621
|
require_relative 'rubocop/cop/style/rescue_standard_error'
|
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.38.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: 2022-
|
13
|
+
date: 2022-11-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -120,7 +120,7 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: 1.
|
123
|
+
version: 1.23.0
|
124
124
|
- - "<"
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '2.0'
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ">="
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 1.
|
133
|
+
version: 1.23.0
|
134
134
|
- - "<"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '2.0'
|
@@ -207,6 +207,8 @@ files:
|
|
207
207
|
- config/obsoletion.yml
|
208
208
|
- exe/rubocop
|
209
209
|
- lib/rubocop.rb
|
210
|
+
- lib/rubocop/arguments_env.rb
|
211
|
+
- lib/rubocop/arguments_file.rb
|
210
212
|
- lib/rubocop/ast_aliases.rb
|
211
213
|
- lib/rubocop/cache_config.rb
|
212
214
|
- lib/rubocop/cached_data.rb
|
@@ -284,8 +286,10 @@ files:
|
|
284
286
|
- lib/rubocop/cop/ignored_node.rb
|
285
287
|
- lib/rubocop/cop/internal_affairs.rb
|
286
288
|
- lib/rubocop/cop/internal_affairs/cop_description.rb
|
289
|
+
- lib/rubocop/cop/internal_affairs/create_empty_file.rb
|
287
290
|
- lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb
|
288
291
|
- lib/rubocop/cop/internal_affairs/example_description.rb
|
292
|
+
- lib/rubocop/cop/internal_affairs/example_heredoc_delimiter.rb
|
289
293
|
- lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb
|
290
294
|
- lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb
|
291
295
|
- lib/rubocop/cop/internal_affairs/method_name_end_with.rb
|
@@ -430,6 +434,7 @@ files:
|
|
430
434
|
- lib/rubocop/cop/lint/duplicate_case_condition.rb
|
431
435
|
- lib/rubocop/cop/lint/duplicate_elsif_condition.rb
|
432
436
|
- lib/rubocop/cop/lint/duplicate_hash_key.rb
|
437
|
+
- lib/rubocop/cop/lint/duplicate_magic_comment.rb
|
433
438
|
- lib/rubocop/cop/lint/duplicate_methods.rb
|
434
439
|
- lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb
|
435
440
|
- lib/rubocop/cop/lint/duplicate_require.rb
|
@@ -795,6 +800,7 @@ files:
|
|
795
800
|
- lib/rubocop/cop/style/object_then.rb
|
796
801
|
- lib/rubocop/cop/style/one_line_conditional.rb
|
797
802
|
- lib/rubocop/cop/style/open_struct_use.rb
|
803
|
+
- lib/rubocop/cop/style/operator_method_call.rb
|
798
804
|
- lib/rubocop/cop/style/option_hash.rb
|
799
805
|
- lib/rubocop/cop/style/optional_arguments.rb
|
800
806
|
- lib/rubocop/cop/style/optional_boolean_parameter.rb
|
@@ -815,6 +821,7 @@ files:
|
|
815
821
|
- lib/rubocop/cop/style/redundant_capital_w.rb
|
816
822
|
- lib/rubocop/cop/style/redundant_condition.rb
|
817
823
|
- lib/rubocop/cop/style/redundant_conditional.rb
|
824
|
+
- lib/rubocop/cop/style/redundant_each.rb
|
818
825
|
- lib/rubocop/cop/style/redundant_exception.rb
|
819
826
|
- lib/rubocop/cop/style/redundant_fetch_block.rb
|
820
827
|
- lib/rubocop/cop/style/redundant_file_extension_in_require.rb
|
@@ -831,6 +838,7 @@ files:
|
|
831
838
|
- lib/rubocop/cop/style/redundant_self_assignment_branch.rb
|
832
839
|
- lib/rubocop/cop/style/redundant_sort.rb
|
833
840
|
- lib/rubocop/cop/style/redundant_sort_by.rb
|
841
|
+
- lib/rubocop/cop/style/redundant_string_escape.rb
|
834
842
|
- lib/rubocop/cop/style/regexp_literal.rb
|
835
843
|
- lib/rubocop/cop/style/rescue_modifier.rb
|
836
844
|
- lib/rubocop/cop/style/rescue_standard_error.rb
|
@@ -977,7 +985,7 @@ metadata:
|
|
977
985
|
homepage_uri: https://rubocop.org/
|
978
986
|
changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
|
979
987
|
source_code_uri: https://github.com/rubocop/rubocop/
|
980
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
988
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.38/
|
981
989
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
982
990
|
rubygems_mfa_required: 'true'
|
983
991
|
post_install_message:
|