rubocop 1.16.0 → 1.18.2
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 +70 -28
- data/lib/rubocop.rb +2 -0
- data/lib/rubocop/cli/command/suggest_extensions.rb +3 -3
- data/lib/rubocop/config_loader.rb +1 -1
- data/lib/rubocop/config_validator.rb +5 -5
- data/lib/rubocop/cop/base.rb +2 -2
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +1 -1
- data/lib/rubocop/cop/bundler/gem_version.rb +38 -4
- data/lib/rubocop/cop/corrector.rb +4 -4
- data/lib/rubocop/cop/generator.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +1 -1
- data/lib/rubocop/cop/layout/argument_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/array_alignment.rb +2 -2
- data/lib/rubocop/cop/layout/block_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +7 -1
- data/lib/rubocop/cop/layout/comment_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/dot_position.rb +7 -1
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +13 -15
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/hash_alignment.rb +12 -9
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +1 -1
- data/lib/rubocop/cop/layout/indentation_width.rb +8 -0
- data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +127 -0
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +2 -2
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/parameter_alignment.rb +2 -2
- data/lib/rubocop/cop/layout/redundant_line_break.rb +11 -9
- data/lib/rubocop/cop/layout/space_around_keyword.rb +12 -0
- data/lib/rubocop/cop/layout/space_around_operators.rb +7 -1
- data/lib/rubocop/cop/lint/literal_as_condition.rb +13 -1
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +32 -17
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +1 -1
- data/lib/rubocop/cop/lint/percent_string_array.rb +1 -1
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +93 -65
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +5 -0
- data/lib/rubocop/cop/lint/symbol_conversion.rb +1 -1
- data/lib/rubocop/cop/lint/unused_block_argument.rb +1 -1
- data/lib/rubocop/cop/lint/useless_assignment.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
- data/lib/rubocop/cop/migration/department_name.rb +3 -1
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +10 -1
- data/lib/rubocop/cop/naming/inclusive_language.rb +249 -0
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +2 -2
- data/lib/rubocop/cop/style/class_and_module_children.rb +14 -0
- data/lib/rubocop/cop/style/comment_annotation.rb +50 -6
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +29 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +2 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +2 -11
- data/lib/rubocop/cop/style/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/style/quoted_symbols.rb +8 -3
- data/lib/rubocop/cop/style/raise_args.rb +2 -0
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +1 -1
- data/lib/rubocop/cop/style/redundant_self.rb +24 -2
- data/lib/rubocop/cop/style/regexp_literal.rb +10 -1
- data/lib/rubocop/cop/style/special_global_vars.rb +3 -3
- data/lib/rubocop/cop/style/string_concatenation.rb +32 -5
- data/lib/rubocop/cop/style/string_literals.rb +2 -2
- data/lib/rubocop/cop/style/swap_values.rb +1 -1
- data/lib/rubocop/cop/style/unpack_first.rb +1 -1
- data/lib/rubocop/cop/variable_force/variable_table.rb +1 -1
- data/lib/rubocop/directive_comment.rb +53 -5
- data/lib/rubocop/options.rb +4 -4
- data/lib/rubocop/rake_task.rb +1 -1
- data/lib/rubocop/remote_config.rb +10 -2
- data/lib/rubocop/rspec/cop_helper.rb +1 -1
- data/lib/rubocop/rspec/expect_offense.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- metadata +9 -7
data/lib/rubocop/options.rb
CHANGED
@@ -12,9 +12,9 @@ module RuboCop
|
|
12
12
|
# @api private
|
13
13
|
class Options
|
14
14
|
E_STDIN_NO_PATH = '-s/--stdin requires exactly one path, relative to the ' \
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
'root of the project. RuboCop will use this path to determine which ' \
|
16
|
+
'cops are enabled (via eg. Include/Exclude), and so that certain cops ' \
|
17
|
+
'like Naming/FileName can be checked.'
|
18
18
|
EXITING_OPTIONS = %i[version verbose_version show_cops].freeze
|
19
19
|
DEFAULT_MAXIMUM_EXCLUSION_ITEMS = 15
|
20
20
|
|
@@ -292,7 +292,7 @@ module RuboCop
|
|
292
292
|
|
293
293
|
if display_only_fail_level_offenses_with_autocorrect?
|
294
294
|
raise OptionArgumentError, '--autocorrect cannot be used with ' \
|
295
|
-
|
295
|
+
'--display-only-fail-level-offenses'
|
296
296
|
end
|
297
297
|
validate_auto_gen_config
|
298
298
|
validate_auto_correct
|
data/lib/rubocop/rake_task.rb
CHANGED
@@ -70,7 +70,7 @@ module RuboCop
|
|
70
70
|
options = full_options.unshift('--auto-correct-all')
|
71
71
|
# `parallel` will automatically be removed from the options internally.
|
72
72
|
# This is a nice to have to suppress the warning message
|
73
|
-
# about parallel and auto-
|
73
|
+
# about parallel and auto-correct not being compatible.
|
74
74
|
options.delete('--parallel')
|
75
75
|
run_cli(verbose, options)
|
76
76
|
end
|
@@ -55,6 +55,7 @@ module RuboCop
|
|
55
55
|
def generate_request(uri)
|
56
56
|
request = Net::HTTP::Get.new(uri.request_uri)
|
57
57
|
|
58
|
+
request.basic_auth(uri.user, uri.password) if uri.user
|
58
59
|
request['If-Modified-Since'] = File.stat(cache_path).mtime.rfc2822 if cache_path_exists?
|
59
60
|
|
60
61
|
yield request
|
@@ -70,7 +71,7 @@ module RuboCop
|
|
70
71
|
begin
|
71
72
|
response.error!
|
72
73
|
rescue StandardError => e
|
73
|
-
message = "#{e.message} while downloading remote config file #{
|
74
|
+
message = "#{e.message} while downloading remote config file #{cloned_url}"
|
74
75
|
raise e, message
|
75
76
|
end
|
76
77
|
end
|
@@ -94,9 +95,16 @@ module RuboCop
|
|
94
95
|
end
|
95
96
|
|
96
97
|
def cache_name_from_uri
|
97
|
-
uri =
|
98
|
+
uri = cloned_url
|
98
99
|
uri.query = nil
|
99
100
|
uri.to_s.gsub!(/[^0-9A-Za-z]/, '-')
|
100
101
|
end
|
102
|
+
|
103
|
+
def cloned_url
|
104
|
+
uri = @uri.clone
|
105
|
+
uri.user = nil if uri.user
|
106
|
+
uri.password = nil if uri.password
|
107
|
+
uri
|
108
|
+
end
|
101
109
|
end
|
102
110
|
end
|
@@ -15,7 +15,7 @@ module CopHelper
|
|
15
15
|
processed_source = parse_source(source, file)
|
16
16
|
unless processed_source.valid_syntax?
|
17
17
|
raise 'Error parsing example code: ' \
|
18
|
-
|
18
|
+
"#{processed_source.diagnostics.map(&:render).join("\n")}"
|
19
19
|
end
|
20
20
|
|
21
21
|
_investigate(cop, processed_source)
|
@@ -195,7 +195,7 @@ module RuboCop
|
|
195
195
|
return processed_source if processed_source.valid_syntax?
|
196
196
|
|
197
197
|
raise 'Error parsing example code: ' \
|
198
|
-
|
198
|
+
"#{processed_source.diagnostics.map(&:render).join("\n")}"
|
199
199
|
end
|
200
200
|
|
201
201
|
def set_formatter_options
|
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.
|
4
|
+
version: 1.18.2
|
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: 2021-
|
13
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parallel
|
@@ -319,6 +319,7 @@ files:
|
|
319
319
|
- lib/rubocop/cop/layout/initial_indentation.rb
|
320
320
|
- lib/rubocop/cop/layout/leading_comment_space.rb
|
321
321
|
- lib/rubocop/cop/layout/leading_empty_lines.rb
|
322
|
+
- lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb
|
322
323
|
- lib/rubocop/cop/layout/line_length.rb
|
323
324
|
- lib/rubocop/cop/layout/multiline_array_brace_layout.rb
|
324
325
|
- lib/rubocop/cop/layout/multiline_array_line_breaks.rb
|
@@ -579,6 +580,7 @@ files:
|
|
579
580
|
- lib/rubocop/cop/naming/file_name.rb
|
580
581
|
- lib/rubocop/cop/naming/heredoc_delimiter_case.rb
|
581
582
|
- lib/rubocop/cop/naming/heredoc_delimiter_naming.rb
|
583
|
+
- lib/rubocop/cop/naming/inclusive_language.rb
|
582
584
|
- lib/rubocop/cop/naming/memoized_instance_variable_name.rb
|
583
585
|
- lib/rubocop/cop/naming/method_name.rb
|
584
586
|
- lib/rubocop/cop/naming/method_parameter_name.rb
|
@@ -881,9 +883,9 @@ metadata:
|
|
881
883
|
homepage_uri: https://rubocop.org/
|
882
884
|
changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
|
883
885
|
source_code_uri: https://github.com/rubocop/rubocop/
|
884
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
886
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.18/
|
885
887
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
886
|
-
post_install_message:
|
888
|
+
post_install_message:
|
887
889
|
rdoc_options: []
|
888
890
|
require_paths:
|
889
891
|
- lib
|
@@ -898,8 +900,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
898
900
|
- !ruby/object:Gem::Version
|
899
901
|
version: '0'
|
900
902
|
requirements: []
|
901
|
-
rubygems_version: 3.
|
902
|
-
signing_key:
|
903
|
+
rubygems_version: 3.2.18
|
904
|
+
signing_key:
|
903
905
|
specification_version: 4
|
904
906
|
summary: Automatic Ruby code style checking tool.
|
905
907
|
test_files: []
|