rubocop 1.81.7 → 1.82.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 +21 -5
- data/config/obsoletion.yml +4 -0
- data/lib/rubocop/cli.rb +2 -1
- data/lib/rubocop/comment_config.rb +62 -17
- data/lib/rubocop/config_loader.rb +2 -1
- data/lib/rubocop/config_loader_resolver.rb +2 -2
- data/lib/rubocop/cop/autocorrect_logic.rb +2 -0
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +1 -3
- data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +10 -5
- data/lib/rubocop/cop/internal_affairs/location_exists.rb +28 -2
- data/lib/rubocop/cop/internal_affairs/node_pattern_groups/ast_processor.rb +1 -1
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +3 -0
- data/lib/rubocop/cop/layout/end_alignment.rb +4 -0
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +2 -2
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +0 -4
- data/lib/rubocop/cop/layout/indentation_style.rb +1 -1
- data/lib/rubocop/cop/layout/line_continuation_spacing.rb +1 -1
- data/lib/rubocop/cop/layout/line_length.rb +7 -4
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +5 -3
- data/lib/rubocop/cop/layout/space_around_keyword.rb +1 -1
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +47 -3
- data/lib/rubocop/cop/lint/cop_directive_syntax.rb +1 -1
- data/lib/rubocop/cop/lint/else_layout.rb +19 -0
- data/lib/rubocop/cop/lint/literal_as_condition.rb +4 -0
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +4 -0
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +23 -9
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +4 -2
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +7 -1
- data/lib/rubocop/cop/lint/self_assignment.rb +9 -1
- data/lib/rubocop/cop/lint/unreachable_code.rb +5 -3
- data/lib/rubocop/cop/lint/useless_or.rb +15 -2
- data/lib/rubocop/cop/lint/utils/nil_receiver_checker.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +4 -3
- data/lib/rubocop/cop/mixin/check_single_line_suitability.rb +0 -4
- data/lib/rubocop/cop/mixin/code_length.rb +1 -1
- data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +1 -1
- data/lib/rubocop/cop/mixin/line_length_help.rb +21 -2
- data/lib/rubocop/cop/mixin/method_complexity.rb +1 -1
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +1 -1
- data/lib/rubocop/cop/mixin/statement_modifier.rb +0 -6
- data/lib/rubocop/cop/mixin/trailing_comma.rb +4 -5
- data/lib/rubocop/cop/naming/method_name.rb +1 -1
- data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -2
- data/lib/rubocop/cop/style/case_equality.rb +11 -13
- data/lib/rubocop/cop/style/class_and_module_children.rb +1 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +1 -11
- data/lib/rubocop/cop/style/constant_visibility.rb +3 -3
- data/lib/rubocop/cop/style/empty_method.rb +0 -6
- data/lib/rubocop/cop/style/endless_method.rb +2 -2
- data/lib/rubocop/cop/style/guard_clause.rb +0 -11
- data/lib/rubocop/cop/style/if_unless_modifier.rb +3 -3
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +12 -1
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +17 -4
- data/lib/rubocop/cop/style/module_member_existence_check.rb +74 -0
- data/lib/rubocop/cop/style/multiline_method_signature.rb +0 -4
- data/lib/rubocop/cop/style/parallel_assignment.rb +2 -2
- data/lib/rubocop/cop/style/redundant_argument.rb +2 -0
- data/lib/rubocop/cop/style/redundant_percent_q.rb +1 -2
- data/lib/rubocop/cop/style/redundant_regexp_argument.rb +5 -0
- data/lib/rubocop/cop/style/redundant_sort.rb +7 -7
- data/lib/rubocop/cop/style/super_arguments.rb +2 -2
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +11 -11
- data/lib/rubocop/cop/util.rb +2 -3
- data/lib/rubocop/directive_comment.rb +46 -3
- data/lib/rubocop/formatter/disabled_config_formatter.rb +1 -0
- data/lib/rubocop/lsp/diagnostic.rb +12 -17
- data/lib/rubocop/lsp/routes.rb +9 -36
- data/lib/rubocop/lsp/runtime.rb +2 -2
- data/lib/rubocop/lsp/server.rb +2 -2
- data/lib/rubocop/magic_comment.rb +20 -0
- data/lib/rubocop/rake_task.rb +1 -1
- data/lib/rubocop/remote_config.rb +7 -8
- data/lib/rubocop/rspec/shared_contexts.rb +2 -2
- data/lib/rubocop/rspec/support.rb +1 -1
- data/lib/rubocop/target_ruby.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- data/lib/rubocop.rb +1 -0
- metadata +7 -6
|
@@ -11,13 +11,13 @@ module RuboCop
|
|
|
11
11
|
|
|
12
12
|
CACHE_LIFETIME = 24 * 60 * 60
|
|
13
13
|
|
|
14
|
-
def initialize(url,
|
|
14
|
+
def initialize(url, cache_root)
|
|
15
15
|
begin
|
|
16
16
|
@uri = URI.parse(url)
|
|
17
17
|
rescue URI::InvalidURIError
|
|
18
18
|
raise ConfigNotFoundError, "Failed to resolve configuration: '#{url}' is not a valid URI"
|
|
19
19
|
end
|
|
20
|
-
@
|
|
20
|
+
@cache_root = cache_root
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def file
|
|
@@ -27,16 +27,17 @@ module RuboCop
|
|
|
27
27
|
next if response.is_a?(Net::HTTPNotModified)
|
|
28
28
|
next if response.is_a?(SocketError)
|
|
29
29
|
|
|
30
|
+
FileUtils.mkdir_p(File.dirname(cache_path))
|
|
30
31
|
File.write(cache_path, response.body)
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
cache_path
|
|
34
35
|
end
|
|
35
36
|
|
|
36
|
-
def inherit_from_remote(file
|
|
37
|
+
def inherit_from_remote(file)
|
|
37
38
|
new_uri = @uri.dup
|
|
38
39
|
new_uri.path.gsub!(%r{/[^/]*$}, "/#{file.delete_prefix('./')}")
|
|
39
|
-
RemoteConfig.new(new_uri.to_s,
|
|
40
|
+
RemoteConfig.new(new_uri.to_s, @cache_root)
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
private
|
|
@@ -80,7 +81,7 @@ module RuboCop
|
|
|
80
81
|
end
|
|
81
82
|
|
|
82
83
|
def cache_path
|
|
83
|
-
File.expand_path(".rubocop-#{cache_name_from_uri}", @
|
|
84
|
+
@cache_path ||= File.expand_path(".rubocop-remote-#{cache_name_from_uri}", @cache_root)
|
|
84
85
|
end
|
|
85
86
|
|
|
86
87
|
def cache_path_exists?
|
|
@@ -97,9 +98,7 @@ module RuboCop
|
|
|
97
98
|
end
|
|
98
99
|
|
|
99
100
|
def cache_name_from_uri
|
|
100
|
-
uri
|
|
101
|
-
uri.query = nil
|
|
102
|
-
uri.to_s.gsub!(/[^0-9A-Za-z]/, '-')
|
|
101
|
+
"#{Digest::MD5.hexdigest(@uri.to_s)}.yml"
|
|
103
102
|
end
|
|
104
103
|
|
|
105
104
|
def cloned_url
|
data/lib/rubocop/target_ruby.rb
CHANGED
|
@@ -4,7 +4,7 @@ module RuboCop
|
|
|
4
4
|
# The kind of Ruby that code inspected by RuboCop is written in.
|
|
5
5
|
# @api private
|
|
6
6
|
class TargetRuby
|
|
7
|
-
KNOWN_RUBIES = [2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4,
|
|
7
|
+
KNOWN_RUBIES = [2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 4.0].freeze
|
|
8
8
|
DEFAULT_VERSION = 2.7
|
|
9
9
|
|
|
10
10
|
OBSOLETE_RUBIES = {
|
data/lib/rubocop/version.rb
CHANGED
data/lib/rubocop.rb
CHANGED
|
@@ -608,6 +608,7 @@ require_relative 'rubocop/cop/style/map_to_set'
|
|
|
608
608
|
require_relative 'rubocop/cop/style/method_call_without_args_parentheses'
|
|
609
609
|
require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
|
|
610
610
|
require_relative 'rubocop/cop/style/min_max_comparison'
|
|
611
|
+
require_relative 'rubocop/cop/style/module_member_existence_check'
|
|
611
612
|
require_relative 'rubocop/cop/style/multiline_in_pattern_then'
|
|
612
613
|
require_relative 'rubocop/cop/style/numbered_parameters'
|
|
613
614
|
require_relative 'rubocop/cop/style/open_struct_use'
|
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.82.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bozhidar Batsov
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
- Yuji Nakayama
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2025-
|
|
12
|
+
date: 2025-12-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: json
|
|
@@ -127,7 +127,7 @@ dependencies:
|
|
|
127
127
|
requirements:
|
|
128
128
|
- - ">="
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: 1.
|
|
130
|
+
version: 1.48.0
|
|
131
131
|
- - "<"
|
|
132
132
|
- !ruby/object:Gem::Version
|
|
133
133
|
version: '2.0'
|
|
@@ -137,7 +137,7 @@ dependencies:
|
|
|
137
137
|
requirements:
|
|
138
138
|
- - ">="
|
|
139
139
|
- !ruby/object:Gem::Version
|
|
140
|
-
version: 1.
|
|
140
|
+
version: 1.48.0
|
|
141
141
|
- - "<"
|
|
142
142
|
- !ruby/object:Gem::Version
|
|
143
143
|
version: '2.0'
|
|
@@ -839,6 +839,7 @@ files:
|
|
|
839
839
|
- lib/rubocop/cop/style/mixin_grouping.rb
|
|
840
840
|
- lib/rubocop/cop/style/mixin_usage.rb
|
|
841
841
|
- lib/rubocop/cop/style/module_function.rb
|
|
842
|
+
- lib/rubocop/cop/style/module_member_existence_check.rb
|
|
842
843
|
- lib/rubocop/cop/style/multiline_block_chain.rb
|
|
843
844
|
- lib/rubocop/cop/style/multiline_if_modifier.rb
|
|
844
845
|
- lib/rubocop/cop/style/multiline_if_then.rb
|
|
@@ -1091,9 +1092,9 @@ licenses:
|
|
|
1091
1092
|
- MIT
|
|
1092
1093
|
metadata:
|
|
1093
1094
|
homepage_uri: https://rubocop.org/
|
|
1094
|
-
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.
|
|
1095
|
+
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.82.0
|
|
1095
1096
|
source_code_uri: https://github.com/rubocop/rubocop/
|
|
1096
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
|
1097
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.82/
|
|
1097
1098
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
|
1098
1099
|
rubygems_mfa_required: 'true'
|
|
1099
1100
|
rdoc_options: []
|