rubocop 1.33.0 → 1.35.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.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/config/default.yml +29 -1
  4. data/lib/rubocop/cli/command/suggest_extensions.rb +53 -15
  5. data/lib/rubocop/config_loader.rb +12 -0
  6. data/lib/rubocop/config_loader_resolver.rb +1 -5
  7. data/lib/rubocop/cop/cop.rb +1 -1
  8. data/lib/rubocop/cop/correctors/parentheses_corrector.rb +58 -0
  9. data/lib/rubocop/cop/gemspec/require_mfa.rb +1 -1
  10. data/lib/rubocop/cop/internal_affairs/numblock_handler.rb +69 -0
  11. data/lib/rubocop/cop/internal_affairs/single_line_comparison.rb +61 -0
  12. data/lib/rubocop/cop/internal_affairs.rb +2 -0
  13. data/lib/rubocop/cop/layout/block_alignment.rb +2 -0
  14. data/lib/rubocop/cop/layout/block_end_newline.rb +4 -1
  15. data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +5 -2
  16. data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +2 -0
  17. data/lib/rubocop/cop/layout/indentation_width.rb +2 -0
  18. data/lib/rubocop/cop/layout/line_length.rb +4 -1
  19. data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
  20. data/lib/rubocop/cop/layout/multiline_block_layout.rb +2 -0
  21. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +1 -1
  22. data/lib/rubocop/cop/layout/space_around_keyword.rb +1 -1
  23. data/lib/rubocop/cop/layout/space_before_block_braces.rb +2 -0
  24. data/lib/rubocop/cop/legacy/corrections_proxy.rb +1 -1
  25. data/lib/rubocop/cop/legacy/corrector.rb +1 -1
  26. data/lib/rubocop/cop/lint/debugger.rb +15 -15
  27. data/lib/rubocop/cop/lint/empty_block.rb +1 -1
  28. data/lib/rubocop/cop/lint/empty_conditional_body.rb +5 -0
  29. data/lib/rubocop/cop/lint/erb_new_arguments.rb +9 -9
  30. data/lib/rubocop/cop/lint/next_without_accumulator.rb +25 -6
  31. data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +12 -0
  32. data/lib/rubocop/cop/lint/redundant_with_index.rb +13 -10
  33. data/lib/rubocop/cop/lint/redundant_with_object.rb +12 -11
  34. data/lib/rubocop/cop/lint/shadowed_exception.rb +15 -0
  35. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +10 -1
  36. data/lib/rubocop/cop/lint/unreachable_loop.rb +7 -1
  37. data/lib/rubocop/cop/lint/useless_access_modifier.rb +6 -4
  38. data/lib/rubocop/cop/lint/void.rb +2 -0
  39. data/lib/rubocop/cop/mixin/enforce_superclass.rb +2 -1
  40. data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +76 -1
  41. data/lib/rubocop/cop/mixin/hash_transform_method.rb +1 -1
  42. data/lib/rubocop/cop/mixin/method_complexity.rb +4 -4
  43. data/lib/rubocop/cop/mixin/range_help.rb +4 -5
  44. data/lib/rubocop/cop/naming/block_parameter_name.rb +1 -1
  45. data/lib/rubocop/cop/style/arguments_forwarding.rb +2 -2
  46. data/lib/rubocop/cop/style/class_methods_definitions.rb +2 -1
  47. data/lib/rubocop/cop/style/collection_methods.rb +2 -0
  48. data/lib/rubocop/cop/style/combinable_loops.rb +3 -1
  49. data/lib/rubocop/cop/style/double_negation.rb +2 -0
  50. data/lib/rubocop/cop/style/each_for_simple_loop.rb +1 -1
  51. data/lib/rubocop/cop/style/each_with_object.rb +39 -8
  52. data/lib/rubocop/cop/style/empty_block_parameter.rb +1 -1
  53. data/lib/rubocop/cop/style/empty_lambda_parameter.rb +1 -1
  54. data/lib/rubocop/cop/style/for.rb +2 -0
  55. data/lib/rubocop/cop/style/hash_each_methods.rb +3 -1
  56. data/lib/rubocop/cop/style/hash_syntax.rb +17 -0
  57. data/lib/rubocop/cop/style/if_unless_modifier.rb +1 -1
  58. data/lib/rubocop/cop/style/inverse_methods.rb +8 -6
  59. data/lib/rubocop/cop/style/magic_comment_format.rb +307 -0
  60. data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +4 -1
  61. data/lib/rubocop/cop/style/multiline_block_chain.rb +3 -1
  62. data/lib/rubocop/cop/style/next.rb +2 -0
  63. data/lib/rubocop/cop/style/nil_lambda.rb +1 -1
  64. data/lib/rubocop/cop/style/numeric_literals.rb +16 -1
  65. data/lib/rubocop/cop/style/object_then.rb +2 -0
  66. data/lib/rubocop/cop/style/proc.rb +4 -1
  67. data/lib/rubocop/cop/style/redundant_begin.rb +2 -0
  68. data/lib/rubocop/cop/style/redundant_fetch_block.rb +1 -1
  69. data/lib/rubocop/cop/style/redundant_parentheses.rb +15 -22
  70. data/lib/rubocop/cop/style/redundant_self.rb +2 -0
  71. data/lib/rubocop/cop/style/redundant_sort_by.rb +24 -8
  72. data/lib/rubocop/cop/style/single_line_block_params.rb +1 -1
  73. data/lib/rubocop/cop/style/sole_nested_conditional.rb +14 -3
  74. data/lib/rubocop/cop/style/symbol_proc.rb +5 -0
  75. data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -13
  76. data/lib/rubocop/cop/style/top_level_method_definition.rb +3 -1
  77. data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +1 -1
  78. data/lib/rubocop/ext/range.rb +15 -0
  79. data/lib/rubocop/feature_loader.rb +92 -0
  80. data/lib/rubocop/formatter/clang_style_formatter.rb +1 -1
  81. data/lib/rubocop/formatter/disabled_config_formatter.rb +1 -1
  82. data/lib/rubocop/formatter/html_formatter.rb +1 -1
  83. data/lib/rubocop/formatter/markdown_formatter.rb +1 -1
  84. data/lib/rubocop/formatter/tap_formatter.rb +1 -1
  85. data/lib/rubocop/server/cache.rb +4 -2
  86. data/lib/rubocop/version.rb +1 -1
  87. data/lib/rubocop.rb +4 -1
  88. metadata +13 -8
@@ -57,8 +57,8 @@ module RuboCop
57
57
  def allowed_expression?(node)
58
58
  allowed_ancestor?(node) ||
59
59
  allowed_method_call?(node) ||
60
- allowed_array_or_hash_element?(node) ||
61
- allowed_multiple_expression?(node)
60
+ allowed_multiple_expression?(node) ||
61
+ allowed_ternary?(node)
62
62
  end
63
63
 
64
64
  def allowed_ancestor?(node)
@@ -80,6 +80,19 @@ module RuboCop
80
80
  !ancestor.begin_type? && !ancestor.def_type? && !ancestor.block_type?
81
81
  end
82
82
 
83
+ def allowed_ternary?(node)
84
+ return unless node&.parent&.if_type?
85
+
86
+ node.parent.ternary? && ternary_parentheses_required?
87
+ end
88
+
89
+ def ternary_parentheses_required?
90
+ config = @config.for_cop('Style/TernaryParentheses')
91
+ allowed_styles = %w[require_parentheses require_parentheses_when_complex]
92
+
93
+ config.fetch('Enabled') && allowed_styles.include?(config['EnforcedStyle'])
94
+ end
95
+
83
96
  def like_method_argument_parentheses?(node)
84
97
  node.send_type? && node.arguments.one? &&
85
98
  !node.arithmetic_operation? && node.first_argument.begin_type?
@@ -153,26 +166,6 @@ module RuboCop
153
166
  node.parent&.keyword?
154
167
  end
155
168
 
156
- def allowed_array_or_hash_element?(node)
157
- # Don't flag
158
- # ```
159
- # { a: (1
160
- # ), }
161
- # ```
162
- hash_or_array_element?(node) && only_closing_paren_before_comma?(node)
163
- end
164
-
165
- def hash_or_array_element?(node)
166
- node.each_ancestor(:array, :hash).any?
167
- end
168
-
169
- def only_closing_paren_before_comma?(node)
170
- source_buffer = node.source_range.source_buffer
171
- line_range = source_buffer.line_range(node.loc.end.line)
172
-
173
- /^\s*\)\s*,/.match?(line_range.source)
174
- end
175
-
176
169
  def disallowed_literal?(begin_node, node)
177
170
  node.literal? && !node.range_type? && !raised_to_power_negative_numeric?(begin_node, node)
178
171
  end
@@ -120,6 +120,8 @@ module RuboCop
120
120
  add_scope(node, @local_variables_scopes[node])
121
121
  end
122
122
 
123
+ alias on_numblock on_block
124
+
123
125
  def on_if(node)
124
126
  # Allow conditional nodes to use `self` in the condition if that variable
125
127
  # name is used in an `lvasgn` or `masgn` within the `if`.
@@ -19,18 +19,24 @@ module RuboCop
19
19
  include RangeHelp
20
20
  extend AutoCorrector
21
21
 
22
- MSG = 'Use `sort` instead of `sort_by { |%<var>s| %<var>s }`.'
23
-
24
- # @!method redundant_sort_by(node)
25
- def_node_matcher :redundant_sort_by, <<~PATTERN
26
- (block $(send _ :sort_by) (args (arg $_x)) (lvar _x))
27
- PATTERN
22
+ MSG_BLOCK = 'Use `sort` instead of `sort_by { |%<var>s| %<var>s }`.'
23
+ MSG_NUMBLOCK = 'Use `sort` instead of `sort_by { _1 }`.'
28
24
 
29
25
  def on_block(node)
30
- redundant_sort_by(node) do |send, var_name|
26
+ redundant_sort_by_block(node) do |send, var_name|
31
27
  range = sort_by_range(send, node)
32
28
 
33
- add_offense(range, message: format(MSG, var: var_name)) do |corrector|
29
+ add_offense(range, message: format(MSG_BLOCK, var: var_name)) do |corrector|
30
+ corrector.replace(range, 'sort')
31
+ end
32
+ end
33
+ end
34
+
35
+ def on_numblock(node)
36
+ redundant_sort_by_numblock(node) do |send|
37
+ range = sort_by_range(send, node)
38
+
39
+ add_offense(range, message: format(MSG_NUMBLOCK)) do |corrector|
34
40
  corrector.replace(range, 'sort')
35
41
  end
36
42
  end
@@ -38,6 +44,16 @@ module RuboCop
38
44
 
39
45
  private
40
46
 
47
+ # @!method redundant_sort_by_block(node)
48
+ def_node_matcher :redundant_sort_by_block, <<~PATTERN
49
+ (block $(send _ :sort_by) (args (arg $_x)) (lvar _x))
50
+ PATTERN
51
+
52
+ # @!method redundant_sort_by_numblock(node)
53
+ def_node_matcher :redundant_sort_by_numblock, <<~PATTERN
54
+ (numblock $(send _ :sort_by) 1 (lvar :_1))
55
+ PATTERN
56
+
41
57
  def sort_by_range(send, node)
42
58
  range_between(send.loc.selector.begin_pos, node.loc.end.end_pos)
43
59
  end
@@ -33,7 +33,7 @@ module RuboCop
33
33
 
34
34
  MSG = 'Name `%<method>s` block params `|%<params>s|`.'
35
35
 
36
- def on_block(node)
36
+ def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
37
37
  return unless node.single_line?
38
38
 
39
39
  return unless eligible_method?(node)
@@ -148,7 +148,18 @@ module RuboCop
148
148
  )
149
149
  corrector.replace(range, and_operator)
150
150
  corrector.remove(range_by_whole_lines(node.loc.end, include_final_newline: true))
151
- corrector.wrap(if_branch.condition, '(', ')') if wrap_condition?(if_branch.condition)
151
+
152
+ wrap_condition(corrector, if_branch.condition)
153
+ end
154
+
155
+ def wrap_condition(corrector, condition)
156
+ # Handle `send` and `block` nodes that need to be wrapped in parens
157
+ # FIXME: autocorrection prevents syntax errors by wrapping the entire node in parens,
158
+ # but wrapping the argument list would be a more ergonomic correction.
159
+ node_to_check = condition&.block_type? ? condition.send_node : condition
160
+ return unless wrap_condition?(node_to_check)
161
+
162
+ corrector.wrap(condition, '(', ')')
152
163
  end
153
164
 
154
165
  def correct_for_outer_condition_modify_form_style(corrector, node, if_branch)
@@ -207,7 +218,7 @@ module RuboCop
207
218
  end
208
219
 
209
220
  def require_parentheses?(condition)
210
- condition.send_type? && !condition.arguments.empty? && !condition.parenthesized? &&
221
+ condition.call_type? && !condition.arguments.empty? && !condition.parenthesized? &&
211
222
  !condition.comparison_method?
212
223
  end
213
224
 
@@ -219,7 +230,7 @@ module RuboCop
219
230
 
220
231
  def wrap_condition?(node)
221
232
  node.and_type? || node.or_type? ||
222
- (node.send_type? && node.arguments.any? && !node.parenthesized?)
233
+ (node.call_type? && node.arguments.any? && !node.parenthesized?)
223
234
  end
224
235
 
225
236
  def replace_condition(condition)
@@ -121,6 +121,7 @@ module RuboCop
121
121
  # we should allow lambdas & procs
122
122
  return if proc_node?(dispatch_node)
123
123
  return if unsafe_hash_usage?(dispatch_node)
124
+ return if unsafe_array_usage?(dispatch_node)
124
125
  return if %i[lambda proc].include?(dispatch_node.method_name)
125
126
  return if allowed_method_name?(dispatch_node.method_name)
126
127
  return if allow_if_method_has_argument?(node.send_node)
@@ -144,6 +145,10 @@ module RuboCop
144
145
  node.receiver&.hash_type? && %i[reject select].include?(node.method_name)
145
146
  end
146
147
 
148
+ def unsafe_array_usage?(node)
149
+ node.receiver&.array_type? && %i[min max].include?(node.method_name)
150
+ end
151
+
147
152
  def allowed_method_name?(name)
148
153
  allowed_method?(name) || matches_allowed_pattern?(name)
149
154
  end
@@ -71,7 +71,7 @@ module RuboCop
71
71
 
72
72
  return if only_closing_parenthesis_is_last_line?(condition)
73
73
  return if condition_as_parenthesized_one_line_pattern_matching?(condition)
74
- return unless node.ternary? && !infinite_loop? && offense?(node)
74
+ return unless node.ternary? && offense?(node)
75
75
 
76
76
  message = message(node)
77
77
 
@@ -166,22 +166,10 @@ module RuboCop
166
166
  style == :require_parentheses_when_complex
167
167
  end
168
168
 
169
- def redundant_parentheses_enabled?
170
- @config.for_cop('Style/RedundantParentheses').fetch('Enabled')
171
- end
172
-
173
169
  def parenthesized?(node)
174
170
  node.begin_type?
175
171
  end
176
172
 
177
- # When this cop is configured to enforce parentheses and the
178
- # `RedundantParentheses` cop is enabled, it will cause an infinite loop
179
- # as they compete to add and remove the parentheses respectively.
180
- def infinite_loop?
181
- (require_parentheses? || require_parentheses_when_complex?) &&
182
- redundant_parentheses_enabled?
183
- end
184
-
185
173
  def unsafe_autocorrect?(condition)
186
174
  condition.children.any? do |child|
187
175
  unparenthesized_method_call?(child) || below_ternary_precedence?(child)
@@ -63,6 +63,8 @@ module RuboCop
63
63
  add_offense(node)
64
64
  end
65
65
 
66
+ alias on_numblock on_block
67
+
66
68
  private
67
69
 
68
70
  def top_level_method_definition?(node)
@@ -75,7 +77,7 @@ module RuboCop
75
77
 
76
78
  # @!method define_method_block?(node)
77
79
  def_node_matcher :define_method_block?, <<~PATTERN
78
- (block (send _ {:define_method} _) ...)
80
+ ({block numblock} (send _ {:define_method} _) ...)
79
81
  PATTERN
80
82
  end
81
83
  end
@@ -64,7 +64,7 @@ module RuboCop
64
64
 
65
65
  MSG = 'Useless trailing comma present in block arguments.'
66
66
 
67
- def on_block(node)
67
+ def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
68
68
  # lambda literal (`->`) never has block arguments.
69
69
  return if node.send_node.lambda_literal?
70
70
  return unless useless_trailing_comma?(node)
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Ext
5
+ # Extensions to Parser::Source::Range
6
+ module Range
7
+ # Adds `Range#single_line?` to parallel `Node#single_line?`
8
+ def single_line?
9
+ first_line == last_line
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ Parser::Source::Range.include RuboCop::Ext::Range
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ # This class handles loading files (a.k.a. features in Ruby) specified
5
+ # by `--require` command line option and `require` directive in the config.
6
+ #
7
+ # Normally, the given string is directly passed to `require`. If a string
8
+ # beginning with `.` is given, it is assumed to be relative to the given
9
+ # directory.
10
+ #
11
+ # If a string containing `-` is given, it will be used as is, but if we
12
+ # cannot find the file to load, we will replace `-` with `/` and try it
13
+ # again as when Bundler loads gems.
14
+ #
15
+ # @api private
16
+ class FeatureLoader
17
+ class << self
18
+ # @param [String] config_directory_path
19
+ # @param [String] feature
20
+ def load(config_directory_path:, feature:)
21
+ new(config_directory_path: config_directory_path, feature: feature).load
22
+ end
23
+ end
24
+
25
+ # @param [String] config_directory_path
26
+ # @param [String] feature
27
+ def initialize(config_directory_path:, feature:)
28
+ @config_directory_path = config_directory_path
29
+ @feature = feature
30
+ end
31
+
32
+ def load
33
+ # Don't use `::Kernel.require(target)` to prevent the following error:
34
+ # https://github.com/rubocop/rubocop/issues/10893
35
+ require(target)
36
+ rescue ::LoadError => e
37
+ raise if e.path != target
38
+
39
+ begin
40
+ # Don't use `::Kernel.require(target)` to prevent the following error:
41
+ # https://github.com/rubocop/rubocop/issues/10893
42
+ require(namespaced_target)
43
+ rescue ::LoadError => error_for_namespaced_target
44
+ raise e if error_for_namespaced_target.path == namespaced_target
45
+
46
+ raise error_for_namespaced_target
47
+ end
48
+ end
49
+
50
+ private
51
+
52
+ # @return [String]
53
+ def namespaced_feature
54
+ @feature.tr('-', '/')
55
+ end
56
+
57
+ # @return [String]
58
+ def namespaced_target
59
+ if relative?
60
+ relative(namespaced_feature)
61
+ else
62
+ namespaced_feature
63
+ end
64
+ end
65
+
66
+ # @param [String]
67
+ # @return [String]
68
+ def relative(feature)
69
+ ::File.join(@config_directory_path, feature)
70
+ end
71
+
72
+ # @return [Boolean]
73
+ def relative?
74
+ @feature.start_with?('.')
75
+ end
76
+
77
+ # @param [LoadError] error
78
+ # @return [Boolean]
79
+ def seems_cannot_load_such_file_error?(error)
80
+ error.path == target
81
+ end
82
+
83
+ # @return [String]
84
+ def target
85
+ if relative?
86
+ relative(@feature)
87
+ else
88
+ @feature
89
+ end
90
+ end
91
+ end
92
+ end
@@ -41,7 +41,7 @@ module RuboCop
41
41
  def report_line(location)
42
42
  source_line = location.source_line
43
43
 
44
- if location.first_line == location.last_line
44
+ if location.single_line?
45
45
  output.puts(source_line)
46
46
  else
47
47
  output.puts("#{source_line} #{yellow(ELLIPSES)}")
@@ -161,7 +161,7 @@ module RuboCop
161
161
  next unless value.is_a?(Array)
162
162
  next if value.empty?
163
163
 
164
- output_buffer.puts "# #{param}: #{value.join(', ')}"
164
+ output_buffer.puts "# #{param}: #{value.uniq.join(', ')}"
165
165
  end
166
166
  end
167
167
 
@@ -115,7 +115,7 @@ module RuboCop
115
115
  end
116
116
 
117
117
  def possible_ellipses(location)
118
- location.first_line == location.last_line ? '' : " #{ELLIPSES}"
118
+ location.single_line? ? '' : " #{ELLIPSES}"
119
119
  end
120
120
 
121
121
  def escape(string)
@@ -71,7 +71,7 @@ module RuboCop
71
71
  end
72
72
 
73
73
  def possible_ellipses(location)
74
- location.first_line == location.last_line ? '' : ' ...'
74
+ location.single_line? ? '' : ' ...'
75
75
  end
76
76
  end
77
77
  end
@@ -29,7 +29,7 @@ module RuboCop
29
29
  def report_line(location)
30
30
  source_line = location.source_line
31
31
 
32
- if location.first_line == location.last_line
32
+ if location.single_line?
33
33
  output.puts("# #{source_line}")
34
34
  else
35
35
  output.puts("# #{source_line} #{yellow(ELLIPSES)}")
@@ -69,10 +69,12 @@ module RuboCop
69
69
  config_yaml = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('4.0.0')
70
70
  YAML.safe_load_file(config_path, permitted_classes: [Regexp, Symbol])
71
71
  else
72
- YAML.load_file(config_path)
72
+ config = YAML.load_file(config_path)
73
+
74
+ config == false ? nil : config
73
75
  end
74
76
 
75
- config_yaml.dig('AllCops', 'CacheRootDirectory')
77
+ config_yaml&.dig('AllCops', 'CacheRootDirectory')
76
78
  end
77
79
  end
78
80
 
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.33.0'
6
+ STRING = '1.35.0'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, ' \
9
9
  'rubocop-ast %<rubocop_ast_version>s, ' \
data/lib/rubocop.rb CHANGED
@@ -16,6 +16,7 @@ require 'rubocop-ast'
16
16
  require_relative 'rubocop/ast_aliases'
17
17
  require_relative 'rubocop/ext/regexp_node'
18
18
  require_relative 'rubocop/ext/regexp_parser'
19
+ require_relative 'rubocop/ext/range'
19
20
 
20
21
  require_relative 'rubocop/core_ext/string'
21
22
  require_relative 'rubocop/ext/processed_source'
@@ -47,6 +48,7 @@ require_relative 'rubocop/cop/severity'
47
48
  require_relative 'rubocop/cop/generator'
48
49
  require_relative 'rubocop/cop/generator/configuration_injector'
49
50
  require_relative 'rubocop/cop/generator/require_file_injector'
51
+ require_relative 'rubocop/magic_comment'
50
52
 
51
53
  require_relative 'rubocop/cop/variable_force'
52
54
  require_relative 'rubocop/cop/variable_force/branch'
@@ -528,6 +530,7 @@ require_relative 'rubocop/cop/style/keyword_parameters_order'
528
530
  require_relative 'rubocop/cop/style/lambda'
529
531
  require_relative 'rubocop/cop/style/lambda_call'
530
532
  require_relative 'rubocop/cop/style/line_end_concatenation'
533
+ require_relative 'rubocop/cop/style/magic_comment_format'
531
534
  require_relative 'rubocop/cop/style/map_to_hash'
532
535
  require_relative 'rubocop/cop/style/method_call_without_args_parentheses'
533
536
  require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
@@ -689,11 +692,11 @@ require_relative 'rubocop/config_obsoletion/split_cop'
689
692
  require_relative 'rubocop/config_obsoletion'
690
693
  require_relative 'rubocop/config_store'
691
694
  require_relative 'rubocop/config_validator'
695
+ require_relative 'rubocop/feature_loader'
692
696
  require_relative 'rubocop/lockfile'
693
697
  require_relative 'rubocop/target_finder'
694
698
  require_relative 'rubocop/directive_comment'
695
699
  require_relative 'rubocop/comment_config'
696
- require_relative 'rubocop/magic_comment'
697
700
  require_relative 'rubocop/result_cache'
698
701
  require_relative 'rubocop/runner'
699
702
  require_relative 'rubocop/cli'
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.33.0
4
+ version: 1.35.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-08-04 00:00:00.000000000 Z
13
+ date: 2022-08-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -46,14 +46,14 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 3.1.0.0
49
+ version: 3.1.2.1
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 3.1.0.0
56
+ version: 3.1.2.1
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rainbow
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -120,7 +120,7 @@ dependencies:
120
120
  requirements:
121
121
  - - ">="
122
122
  - !ruby/object:Gem::Version
123
- version: 1.19.1
123
+ version: 1.20.1
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.19.1
133
+ version: 1.20.1
134
134
  - - "<"
135
135
  - !ruby/object:Gem::Version
136
136
  version: '2.0'
@@ -293,6 +293,7 @@ files:
293
293
  - lib/rubocop/cop/internal_affairs/node_destructuring.rb
294
294
  - lib/rubocop/cop/internal_affairs/node_matcher_directive.rb
295
295
  - lib/rubocop/cop/internal_affairs/node_type_predicate.rb
296
+ - lib/rubocop/cop/internal_affairs/numblock_handler.rb
296
297
  - lib/rubocop/cop/internal_affairs/offense_location_keyword.rb
297
298
  - lib/rubocop/cop/internal_affairs/redundant_context_config_parameter.rb
298
299
  - lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb
@@ -300,6 +301,7 @@ files:
300
301
  - lib/rubocop/cop/internal_affairs/redundant_location_argument.rb
301
302
  - lib/rubocop/cop/internal_affairs/redundant_message_argument.rb
302
303
  - lib/rubocop/cop/internal_affairs/redundant_method_dispatch_node.rb
304
+ - lib/rubocop/cop/internal_affairs/single_line_comparison.rb
303
305
  - lib/rubocop/cop/internal_affairs/style_detected_api_use.rb
304
306
  - lib/rubocop/cop/internal_affairs/undefined_config.rb
305
307
  - lib/rubocop/cop/internal_affairs/useless_message_assertion.rb
@@ -747,6 +749,7 @@ files:
747
749
  - lib/rubocop/cop/style/lambda.rb
748
750
  - lib/rubocop/cop/style/lambda_call.rb
749
751
  - lib/rubocop/cop/style/line_end_concatenation.rb
752
+ - lib/rubocop/cop/style/magic_comment_format.rb
750
753
  - lib/rubocop/cop/style/map_compact_with_conditional_block.rb
751
754
  - lib/rubocop/cop/style/map_to_hash.rb
752
755
  - lib/rubocop/cop/style/method_call_with_args_parentheses.rb
@@ -898,8 +901,10 @@ files:
898
901
  - lib/rubocop/directive_comment.rb
899
902
  - lib/rubocop/error.rb
900
903
  - lib/rubocop/ext/processed_source.rb
904
+ - lib/rubocop/ext/range.rb
901
905
  - lib/rubocop/ext/regexp_node.rb
902
906
  - lib/rubocop/ext/regexp_parser.rb
907
+ - lib/rubocop/feature_loader.rb
903
908
  - lib/rubocop/file_finder.rb
904
909
  - lib/rubocop/formatter.rb
905
910
  - lib/rubocop/formatter/auto_gen_config_formatter.rb
@@ -972,7 +977,7 @@ metadata:
972
977
  homepage_uri: https://rubocop.org/
973
978
  changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
974
979
  source_code_uri: https://github.com/rubocop/rubocop/
975
- documentation_uri: https://docs.rubocop.org/rubocop/1.33/
980
+ documentation_uri: https://docs.rubocop.org/rubocop/1.35/
976
981
  bug_tracker_uri: https://github.com/rubocop/rubocop/issues
977
982
  rubygems_mfa_required: 'true'
978
983
  post_install_message:
@@ -990,7 +995,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
990
995
  - !ruby/object:Gem::Version
991
996
  version: '0'
992
997
  requirements: []
993
- rubygems_version: 3.1.2
998
+ rubygems_version: 3.2.22
994
999
  signing_key:
995
1000
  specification_version: 4
996
1001
  summary: Automatic Ruby code style checking tool.