rubocop 1.39.0 → 1.44.1

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 (188) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +2 -2
  4. data/config/default.yml +149 -11
  5. data/exe/rubocop +1 -1
  6. data/lib/rubocop/cli.rb +1 -1
  7. data/lib/rubocop/comment_config.rb +5 -0
  8. data/lib/rubocop/config.rb +39 -15
  9. data/lib/rubocop/config_loader.rb +26 -20
  10. data/lib/rubocop/config_loader_resolver.rb +6 -2
  11. data/lib/rubocop/config_validator.rb +1 -1
  12. data/lib/rubocop/cop/badge.rb +9 -4
  13. data/lib/rubocop/cop/base.rb +84 -74
  14. data/lib/rubocop/cop/commissioner.rb +8 -3
  15. data/lib/rubocop/cop/cop.rb +29 -29
  16. data/lib/rubocop/cop/corrector.rb +30 -10
  17. data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +22 -6
  18. data/lib/rubocop/cop/correctors/ordered_gem_corrector.rb +1 -6
  19. data/lib/rubocop/cop/gemspec/dependency_version.rb +16 -18
  20. data/lib/rubocop/cop/gemspec/development_dependencies.rb +107 -0
  21. data/lib/rubocop/cop/internal_affairs/cop_description.rb +3 -1
  22. data/lib/rubocop/cop/internal_affairs/lambda_or_proc.rb +46 -0
  23. data/lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb +11 -3
  24. data/lib/rubocop/cop/internal_affairs.rb +1 -0
  25. data/lib/rubocop/cop/layout/block_end_newline.rb +7 -1
  26. data/lib/rubocop/cop/layout/class_structure.rb +32 -11
  27. data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +2 -6
  28. data/lib/rubocop/cop/layout/comment_indentation.rb +3 -1
  29. data/lib/rubocop/cop/layout/empty_lines.rb +2 -0
  30. data/lib/rubocop/cop/layout/extra_spacing.rb +10 -6
  31. data/lib/rubocop/cop/layout/first_array_element_line_break.rb +38 -2
  32. data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +49 -2
  33. data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +61 -2
  34. data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +52 -2
  35. data/lib/rubocop/cop/layout/heredoc_indentation.rb +6 -9
  36. data/lib/rubocop/cop/layout/indentation_style.rb +7 -2
  37. data/lib/rubocop/cop/layout/line_continuation_leading_space.rb +5 -0
  38. data/lib/rubocop/cop/layout/line_continuation_spacing.rb +11 -5
  39. data/lib/rubocop/cop/layout/line_length.rb +2 -0
  40. data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +51 -2
  41. data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
  42. data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +49 -2
  43. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +53 -2
  44. data/lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb +58 -2
  45. data/lib/rubocop/cop/layout/redundant_line_break.rb +2 -2
  46. data/lib/rubocop/cop/layout/space_around_keyword.rb +1 -1
  47. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +0 -2
  48. data/lib/rubocop/cop/layout/trailing_empty_lines.rb +1 -1
  49. data/lib/rubocop/cop/layout/trailing_whitespace.rb +11 -4
  50. data/lib/rubocop/cop/lint/ambiguous_block_association.rb +1 -1
  51. data/lib/rubocop/cop/lint/ambiguous_operator.rb +4 -0
  52. data/lib/rubocop/cop/lint/assignment_in_condition.rb +11 -1
  53. data/lib/rubocop/cop/lint/constant_resolution.rb +4 -0
  54. data/lib/rubocop/cop/lint/debugger.rb +3 -1
  55. data/lib/rubocop/cop/lint/deprecated_class_methods.rb +62 -112
  56. data/lib/rubocop/cop/lint/deprecated_constants.rb +8 -1
  57. data/lib/rubocop/cop/lint/duplicate_branch.rb +0 -2
  58. data/lib/rubocop/cop/lint/duplicate_methods.rb +19 -8
  59. data/lib/rubocop/cop/lint/else_layout.rb +2 -6
  60. data/lib/rubocop/cop/lint/empty_block.rb +1 -5
  61. data/lib/rubocop/cop/lint/empty_conditional_body.rb +1 -1
  62. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +11 -7
  63. data/lib/rubocop/cop/lint/heredoc_method_call_position.rb +15 -17
  64. data/lib/rubocop/cop/lint/interpolation_check.rb +4 -3
  65. data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +1 -0
  66. data/lib/rubocop/cop/lint/non_atomic_file_operation.rb +10 -5
  67. data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +19 -0
  68. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +5 -0
  69. data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +15 -3
  70. data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +1 -1
  71. data/lib/rubocop/cop/lint/redundant_require_statement.rb +11 -1
  72. data/lib/rubocop/cop/lint/regexp_as_condition.rb +6 -0
  73. data/lib/rubocop/cop/lint/require_parentheses.rb +3 -1
  74. data/lib/rubocop/cop/lint/safe_navigation_chain.rb +10 -12
  75. data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +5 -4
  76. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +4 -3
  77. data/lib/rubocop/cop/lint/unused_method_argument.rb +2 -1
  78. data/lib/rubocop/cop/lint/useless_method_definition.rb +3 -3
  79. data/lib/rubocop/cop/lint/useless_rescue.rb +85 -0
  80. data/lib/rubocop/cop/lint/useless_ruby2_keywords.rb +14 -4
  81. data/lib/rubocop/cop/lint/void.rb +25 -16
  82. data/lib/rubocop/cop/metrics/block_length.rb +9 -4
  83. data/lib/rubocop/cop/metrics/block_nesting.rb +1 -1
  84. data/lib/rubocop/cop/metrics/class_length.rb +10 -5
  85. data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +1 -1
  86. data/lib/rubocop/cop/metrics/method_length.rb +9 -4
  87. data/lib/rubocop/cop/metrics/module_length.rb +10 -5
  88. data/lib/rubocop/cop/metrics/parameter_lists.rb +27 -0
  89. data/lib/rubocop/cop/metrics/perceived_complexity.rb +1 -1
  90. data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +3 -6
  91. data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +6 -3
  92. data/lib/rubocop/cop/mixin/alignment.rb +2 -2
  93. data/lib/rubocop/cop/mixin/allowed_identifiers.rb +2 -2
  94. data/lib/rubocop/cop/mixin/annotation_comment.rb +13 -6
  95. data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +21 -9
  96. data/lib/rubocop/cop/mixin/first_element_line_break.rb +11 -7
  97. data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +59 -6
  98. data/lib/rubocop/cop/mixin/line_length_help.rb +11 -2
  99. data/lib/rubocop/cop/mixin/method_complexity.rb +5 -3
  100. data/lib/rubocop/cop/mixin/multiline_element_line_breaks.rb +5 -3
  101. data/lib/rubocop/cop/mixin/percent_array.rb +3 -5
  102. data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +1 -1
  103. data/lib/rubocop/cop/mixin/require_library.rb +2 -0
  104. data/lib/rubocop/cop/mixin/rescue_node.rb +3 -3
  105. data/lib/rubocop/cop/mixin/statement_modifier.rb +16 -1
  106. data/lib/rubocop/cop/naming/block_forwarding.rb +5 -1
  107. data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +2 -0
  108. data/lib/rubocop/cop/naming/inclusive_language.rb +4 -1
  109. data/lib/rubocop/cop/registry.rb +63 -43
  110. data/lib/rubocop/cop/security/compound_hash.rb +2 -1
  111. data/lib/rubocop/cop/style/access_modifier_declarations.rb +18 -10
  112. data/lib/rubocop/cop/style/alias.rb +9 -1
  113. data/lib/rubocop/cop/style/array_intersect.rb +111 -0
  114. data/lib/rubocop/cop/style/block_comments.rb +1 -1
  115. data/lib/rubocop/cop/style/block_delimiters.rb +8 -2
  116. data/lib/rubocop/cop/style/class_and_module_children.rb +2 -9
  117. data/lib/rubocop/cop/style/comparable_clamp.rb +125 -0
  118. data/lib/rubocop/cop/style/concat_array_literals.rb +86 -0
  119. data/lib/rubocop/cop/style/conditional_assignment.rb +0 -6
  120. data/lib/rubocop/cop/style/documentation.rb +11 -5
  121. data/lib/rubocop/cop/style/guard_clause.rb +44 -9
  122. data/lib/rubocop/cop/style/hash_each_methods.rb +13 -1
  123. data/lib/rubocop/cop/style/hash_syntax.rb +11 -7
  124. data/lib/rubocop/cop/style/identical_conditional_branches.rb +15 -0
  125. data/lib/rubocop/cop/style/if_with_semicolon.rb +4 -4
  126. data/lib/rubocop/cop/style/infinite_loop.rb +2 -5
  127. data/lib/rubocop/cop/style/inverse_methods.rb +2 -0
  128. data/lib/rubocop/cop/style/invertible_unless_condition.rb +114 -0
  129. data/lib/rubocop/cop/style/line_end_concatenation.rb +4 -1
  130. data/lib/rubocop/cop/style/map_to_set.rb +61 -0
  131. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +23 -14
  132. data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +2 -0
  133. data/lib/rubocop/cop/style/method_def_parentheses.rb +11 -4
  134. data/lib/rubocop/cop/style/min_max_comparison.rb +83 -0
  135. data/lib/rubocop/cop/style/missing_else.rb +13 -1
  136. data/lib/rubocop/cop/style/multiline_if_modifier.rb +0 -4
  137. data/lib/rubocop/cop/style/multiline_memoization.rb +2 -2
  138. data/lib/rubocop/cop/style/negated_if_else_condition.rb +1 -5
  139. data/lib/rubocop/cop/style/nil_lambda.rb +1 -1
  140. data/lib/rubocop/cop/style/one_line_conditional.rb +3 -6
  141. data/lib/rubocop/cop/style/operator_method_call.rb +15 -1
  142. data/lib/rubocop/cop/style/parallel_assignment.rb +3 -1
  143. data/lib/rubocop/cop/style/redundant_argument.rb +3 -0
  144. data/lib/rubocop/cop/style/redundant_conditional.rb +0 -4
  145. data/lib/rubocop/cop/style/redundant_constant_base.rb +85 -0
  146. data/lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb +45 -0
  147. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +2 -1
  148. data/lib/rubocop/cop/style/redundant_return.rb +7 -0
  149. data/lib/rubocop/cop/style/redundant_sort.rb +1 -1
  150. data/lib/rubocop/cop/style/redundant_string_escape.rb +6 -3
  151. data/lib/rubocop/cop/style/require_order.rb +135 -0
  152. data/lib/rubocop/cop/style/safe_navigation.rb +35 -6
  153. data/lib/rubocop/cop/style/select_by_regexp.rb +13 -5
  154. data/lib/rubocop/cop/style/self_assignment.rb +2 -2
  155. data/lib/rubocop/cop/style/semicolon.rb +26 -3
  156. data/lib/rubocop/cop/style/signal_exception.rb +8 -6
  157. data/lib/rubocop/cop/style/string_hash_keys.rb +4 -1
  158. data/lib/rubocop/cop/style/string_literals.rb +1 -5
  159. data/lib/rubocop/cop/style/symbol_proc.rb +2 -4
  160. data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +4 -4
  161. data/lib/rubocop/cop/style/word_array.rb +41 -0
  162. data/lib/rubocop/cop/style/yoda_expression.rb +81 -0
  163. data/lib/rubocop/cop/style/zero_length_predicate.rb +31 -14
  164. data/lib/rubocop/cop/team.rb +30 -30
  165. data/lib/rubocop/cop/util.rb +32 -5
  166. data/lib/rubocop/cop/variable_force/assignment.rb +1 -1
  167. data/lib/rubocop/cop/variable_force/variable_table.rb +3 -1
  168. data/lib/rubocop/cop/variable_force.rb +18 -30
  169. data/lib/rubocop/cops_documentation_generator.rb +33 -11
  170. data/lib/rubocop/directive_comment.rb +1 -1
  171. data/lib/rubocop/file_patterns.rb +43 -0
  172. data/lib/rubocop/formatter/disabled_config_formatter.rb +17 -6
  173. data/lib/rubocop/formatter/html_formatter.rb +1 -1
  174. data/lib/rubocop/formatter.rb +4 -1
  175. data/lib/rubocop/options.rb +8 -0
  176. data/lib/rubocop/path_util.rb +50 -22
  177. data/lib/rubocop/result_cache.rb +2 -2
  178. data/lib/rubocop/rspec/cop_helper.rb +4 -1
  179. data/lib/rubocop/rspec/expect_offense.rb +6 -4
  180. data/lib/rubocop/rspec/support.rb +2 -2
  181. data/lib/rubocop/runner.rb +10 -3
  182. data/lib/rubocop/server/cache.rb +3 -1
  183. data/lib/rubocop/server/core.rb +1 -1
  184. data/lib/rubocop/target_finder.rb +1 -1
  185. data/lib/rubocop/target_ruby.rb +1 -2
  186. data/lib/rubocop/version.rb +1 -1
  187. data/lib/rubocop.rb +23 -6
  188. metadata +23 -9
@@ -27,6 +27,11 @@ module RuboCop
27
27
  # @api private
28
28
  MAX_ITERATIONS = 200
29
29
 
30
+ # @api private
31
+ REDUNDANT_COP_DISABLE_DIRECTIVE_RULES = %w[
32
+ Lint/RedundantCopDisableDirective RedundantCopDisableDirective Lint
33
+ ].freeze
34
+
30
35
  attr_reader :errors, :warnings
31
36
  attr_writer :aborting
32
37
 
@@ -194,7 +199,9 @@ module RuboCop
194
199
  end
195
200
 
196
201
  def check_for_redundant_disables?(source)
197
- !source.disabled_line_ranges.empty? && !filtered_run?
202
+ return false if source.disabled_line_ranges.empty? || except_redundant_cop_disable_directive?
203
+
204
+ !@options[:only]
198
205
  end
199
206
 
200
207
  def redundant_cop_disable_directive(file)
@@ -205,8 +212,8 @@ module RuboCop
205
212
  yield cop if cop.relevant_file?(file)
206
213
  end
207
214
 
208
- def filtered_run?
209
- @options[:except] || @options[:only]
215
+ def except_redundant_cop_disable_directive?
216
+ @options[:except] && (@options[:except] & REDUNDANT_COP_DISABLE_DIRECTIVE_RULES).any?
210
217
  end
211
218
 
212
219
  def file_started(file)
@@ -68,7 +68,9 @@ module RuboCop
68
68
  file_contents = File.read(config_path)
69
69
  yaml_code = ERB.new(file_contents).result
70
70
 
71
- config_yaml = YAML.safe_load(yaml_code, permitted_classes: [Regexp, Symbol])
71
+ config_yaml = YAML.safe_load(
72
+ yaml_code, permitted_classes: [Regexp, Symbol], aliases: true
73
+ )
72
74
 
73
75
  # For compatibility with Ruby 3.0 or lower.
74
76
  if Gem::Version.new(Psych::VERSION) < Gem::Version.new('4.0.0')
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'socket'
4
3
  require 'securerandom'
4
+ require 'socket'
5
5
 
6
6
  #
7
7
  # This code is based on https://github.com/fohte/rubocop-daemon.
@@ -88,7 +88,7 @@ module RuboCop
88
88
  patterns.map! { |dir| File.join(dir, '*') }
89
89
  # We need this special case to avoid creating the pattern
90
90
  # /**/* which searches the entire file system.
91
- patterns = [File.join(dir, '**/*')] if patterns.empty?
91
+ patterns = [File.join(base_dir, '**/*')] if patterns.empty?
92
92
 
93
93
  Dir.glob(patterns, flags).select { |path| FileTest.file?(path) }
94
94
  end
@@ -84,7 +84,7 @@ module RuboCop
84
84
  # @api private
85
85
  class ToolVersionsFile < RubyVersionFile
86
86
  TOOL_VERSIONS_FILENAME = '.tool-versions'
87
- TOOL_VERSIONS_PATTERN = /\Aruby (?:ruby-)?(?<version>\d+\.\d+)/.freeze
87
+ TOOL_VERSIONS_PATTERN = /^(?:ruby )(?<version>\d+\.\d+)/.freeze
88
88
 
89
89
  def name
90
90
  "`#{TOOL_VERSIONS_FILENAME}`"
@@ -244,7 +244,6 @@ module RuboCop
244
244
  ].freeze
245
245
 
246
246
  private_constant :SOURCES
247
-
248
247
  def initialize(config)
249
248
  @config = config
250
249
  end
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.39.0'
6
+ STRING = '1.44.1'
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
@@ -4,9 +4,9 @@ require 'English'
4
4
  before_us = $LOADED_FEATURES.dup
5
5
  require 'rainbow'
6
6
 
7
- require 'set'
8
7
  require 'forwardable'
9
8
  require 'regexp_parser'
9
+ require 'set'
10
10
  require 'unicode/display_width'
11
11
 
12
12
  # we have to require RuboCop's version, before rubocop-ast's
@@ -14,21 +14,24 @@ require_relative 'rubocop/version'
14
14
  require 'rubocop-ast'
15
15
 
16
16
  require_relative 'rubocop/ast_aliases'
17
+ require_relative 'rubocop/ext/range'
17
18
  require_relative 'rubocop/ext/regexp_node'
18
19
  require_relative 'rubocop/ext/regexp_parser'
19
- require_relative 'rubocop/ext/range'
20
20
 
21
21
  require_relative 'rubocop/core_ext/string'
22
22
  require_relative 'rubocop/ext/processed_source'
23
23
 
24
- require_relative 'rubocop/path_util'
24
+ require_relative 'rubocop/error'
25
25
  require_relative 'rubocop/file_finder'
26
- require_relative 'rubocop/platform'
26
+ require_relative 'rubocop/file_patterns'
27
27
  require_relative 'rubocop/name_similarity'
28
+ require_relative 'rubocop/path_util'
29
+ require_relative 'rubocop/platform'
28
30
  require_relative 'rubocop/string_interpreter'
29
- require_relative 'rubocop/error'
30
- require_relative 'rubocop/warning'
31
31
  require_relative 'rubocop/util'
32
+ require_relative 'rubocop/warning'
33
+
34
+ # rubocop:disable Style/RequireOrder
32
35
 
33
36
  require_relative 'rubocop/cop/util'
34
37
  require_relative 'rubocop/cop/offense'
@@ -163,6 +166,7 @@ require_relative 'rubocop/cop/bundler/ordered_gems'
163
166
 
164
167
  require_relative 'rubocop/cop/gemspec/dependency_version'
165
168
  require_relative 'rubocop/cop/gemspec/deprecated_attribute_assignment'
169
+ require_relative 'rubocop/cop/gemspec/development_dependencies'
166
170
  require_relative 'rubocop/cop/gemspec/duplicated_assignment'
167
171
  require_relative 'rubocop/cop/gemspec/ordered_dependencies'
168
172
  require_relative 'rubocop/cop/gemspec/require_mfa'
@@ -396,6 +400,7 @@ require_relative 'rubocop/cop/lint/useless_access_modifier'
396
400
  require_relative 'rubocop/cop/lint/useless_assignment'
397
401
  require_relative 'rubocop/cop/lint/useless_else_without_rescue'
398
402
  require_relative 'rubocop/cop/lint/useless_method_definition'
403
+ require_relative 'rubocop/cop/lint/useless_rescue'
399
404
  require_relative 'rubocop/cop/lint/useless_ruby2_keywords'
400
405
  require_relative 'rubocop/cop/lint/useless_setter_call'
401
406
  require_relative 'rubocop/cop/lint/useless_times'
@@ -440,6 +445,7 @@ require_relative 'rubocop/cop/style/alias'
440
445
  require_relative 'rubocop/cop/style/and_or'
441
446
  require_relative 'rubocop/cop/style/arguments_forwarding'
442
447
  require_relative 'rubocop/cop/style/array_coercion'
448
+ require_relative 'rubocop/cop/style/array_intersect'
443
449
  require_relative 'rubocop/cop/style/array_join'
444
450
  require_relative 'rubocop/cop/style/ascii_comments'
445
451
  require_relative 'rubocop/cop/style/attr'
@@ -466,6 +472,8 @@ require_relative 'rubocop/cop/style/combinable_loops'
466
472
  require_relative 'rubocop/cop/style/command_literal'
467
473
  require_relative 'rubocop/cop/style/comment_annotation'
468
474
  require_relative 'rubocop/cop/style/commented_keyword'
475
+ require_relative 'rubocop/cop/style/comparable_clamp'
476
+ require_relative 'rubocop/cop/style/concat_array_literals'
469
477
  require_relative 'rubocop/cop/style/conditional_assignment'
470
478
  require_relative 'rubocop/cop/style/constant_visibility'
471
479
  require_relative 'rubocop/cop/style/copyright'
@@ -526,6 +534,7 @@ require_relative 'rubocop/cop/style/in_pattern_then'
526
534
  require_relative 'rubocop/cop/style/infinite_loop'
527
535
  require_relative 'rubocop/cop/style/inverse_methods'
528
536
  require_relative 'rubocop/cop/style/inline_comment'
537
+ require_relative 'rubocop/cop/style/invertible_unless_condition'
529
538
  require_relative 'rubocop/cop/style/ip_addresses'
530
539
  require_relative 'rubocop/cop/style/keyword_parameters_order'
531
540
  require_relative 'rubocop/cop/style/lambda'
@@ -533,19 +542,24 @@ require_relative 'rubocop/cop/style/lambda_call'
533
542
  require_relative 'rubocop/cop/style/line_end_concatenation'
534
543
  require_relative 'rubocop/cop/style/magic_comment_format'
535
544
  require_relative 'rubocop/cop/style/map_to_hash'
545
+ require_relative 'rubocop/cop/style/map_to_set'
536
546
  require_relative 'rubocop/cop/style/method_call_without_args_parentheses'
537
547
  require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
548
+ require_relative 'rubocop/cop/style/min_max_comparison'
538
549
  require_relative 'rubocop/cop/style/multiline_in_pattern_then'
539
550
  require_relative 'rubocop/cop/style/numbered_parameters'
540
551
  require_relative 'rubocop/cop/style/open_struct_use'
541
552
  require_relative 'rubocop/cop/style/operator_method_call'
542
553
  require_relative 'rubocop/cop/style/redundant_assignment'
554
+ require_relative 'rubocop/cop/style/redundant_constant_base'
555
+ require_relative 'rubocop/cop/style/redundant_double_splat_hash_braces'
543
556
  require_relative 'rubocop/cop/style/redundant_each'
544
557
  require_relative 'rubocop/cop/style/redundant_fetch_block'
545
558
  require_relative 'rubocop/cop/style/redundant_file_extension_in_require'
546
559
  require_relative 'rubocop/cop/style/redundant_initialize'
547
560
  require_relative 'rubocop/cop/style/redundant_self_assignment'
548
561
  require_relative 'rubocop/cop/style/redundant_self_assignment_branch'
562
+ require_relative 'rubocop/cop/style/require_order'
549
563
  require_relative 'rubocop/cop/style/sole_nested_conditional'
550
564
  require_relative 'rubocop/cop/style/static_class'
551
565
  require_relative 'rubocop/cop/style/map_compact_with_conditional_block'
@@ -667,6 +681,7 @@ require_relative 'rubocop/cop/style/while_until_do'
667
681
  require_relative 'rubocop/cop/style/while_until_modifier'
668
682
  require_relative 'rubocop/cop/style/word_array'
669
683
  require_relative 'rubocop/cop/style/yoda_condition'
684
+ require_relative 'rubocop/cop/style/yoda_expression'
670
685
  require_relative 'rubocop/cop/style/zero_length_predicate'
671
686
 
672
687
  require_relative 'rubocop/cop/security/compound_hash'
@@ -720,6 +735,8 @@ require_relative 'rubocop/remote_config'
720
735
  require_relative 'rubocop/target_ruby'
721
736
  require_relative 'rubocop/yaml_duplication_checker'
722
737
 
738
+ # rubocop:enable Style/RequireOrder
739
+
723
740
  unless File.exist?("#{__dir__}/../rubocop.gemspec") # Check if we are a gem
724
741
  RuboCop::ResultCache.rubocop_required_features = $LOADED_FEATURES - before_us
725
742
  end
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.39.0
4
+ version: 1.44.1
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-11-14 00:00:00.000000000 Z
13
+ date: 2023-01-25 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.2.1
49
+ version: 3.2.0.0
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.2.1
56
+ version: 3.2.0.0
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.23.0
123
+ version: 1.24.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.23.0
133
+ version: 1.24.1
134
134
  - - "<"
135
135
  - !ruby/object:Gem::Version
136
136
  version: '2.0'
@@ -154,7 +154,7 @@ dependencies:
154
154
  requirements:
155
155
  - - ">="
156
156
  - !ruby/object:Gem::Version
157
- version: 1.4.0
157
+ version: 2.4.0
158
158
  - - "<"
159
159
  - !ruby/object:Gem::Version
160
160
  version: '3.0'
@@ -164,7 +164,7 @@ dependencies:
164
164
  requirements:
165
165
  - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 1.4.0
167
+ version: 2.4.0
168
168
  - - "<"
169
169
  - !ruby/object:Gem::Version
170
170
  version: '3.0'
@@ -275,6 +275,7 @@ files:
275
275
  - lib/rubocop/cop/force.rb
276
276
  - lib/rubocop/cop/gemspec/dependency_version.rb
277
277
  - lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb
278
+ - lib/rubocop/cop/gemspec/development_dependencies.rb
278
279
  - lib/rubocop/cop/gemspec/duplicated_assignment.rb
279
280
  - lib/rubocop/cop/gemspec/ordered_dependencies.rb
280
281
  - lib/rubocop/cop/gemspec/require_mfa.rb
@@ -291,6 +292,7 @@ files:
291
292
  - lib/rubocop/cop/internal_affairs/example_description.rb
292
293
  - lib/rubocop/cop/internal_affairs/example_heredoc_delimiter.rb
293
294
  - lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb
295
+ - lib/rubocop/cop/internal_affairs/lambda_or_proc.rb
294
296
  - lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb
295
297
  - lib/rubocop/cop/internal_affairs/method_name_end_with.rb
296
298
  - lib/rubocop/cop/internal_affairs/method_name_equal.rb
@@ -538,6 +540,7 @@ files:
538
540
  - lib/rubocop/cop/lint/useless_assignment.rb
539
541
  - lib/rubocop/cop/lint/useless_else_without_rescue.rb
540
542
  - lib/rubocop/cop/lint/useless_method_definition.rb
543
+ - lib/rubocop/cop/lint/useless_rescue.rb
541
544
  - lib/rubocop/cop/lint/useless_ruby2_keywords.rb
542
545
  - lib/rubocop/cop/lint/useless_setter_call.rb
543
546
  - lib/rubocop/cop/lint/useless_times.rb
@@ -662,6 +665,7 @@ files:
662
665
  - lib/rubocop/cop/style/and_or.rb
663
666
  - lib/rubocop/cop/style/arguments_forwarding.rb
664
667
  - lib/rubocop/cop/style/array_coercion.rb
668
+ - lib/rubocop/cop/style/array_intersect.rb
665
669
  - lib/rubocop/cop/style/array_join.rb
666
670
  - lib/rubocop/cop/style/ascii_comments.rb
667
671
  - lib/rubocop/cop/style/attr.rb
@@ -689,6 +693,8 @@ files:
689
693
  - lib/rubocop/cop/style/command_literal.rb
690
694
  - lib/rubocop/cop/style/comment_annotation.rb
691
695
  - lib/rubocop/cop/style/commented_keyword.rb
696
+ - lib/rubocop/cop/style/comparable_clamp.rb
697
+ - lib/rubocop/cop/style/concat_array_literals.rb
692
698
  - lib/rubocop/cop/style/conditional_assignment.rb
693
699
  - lib/rubocop/cop/style/constant_visibility.rb
694
700
  - lib/rubocop/cop/style/copyright.rb
@@ -749,6 +755,7 @@ files:
749
755
  - lib/rubocop/cop/style/infinite_loop.rb
750
756
  - lib/rubocop/cop/style/inline_comment.rb
751
757
  - lib/rubocop/cop/style/inverse_methods.rb
758
+ - lib/rubocop/cop/style/invertible_unless_condition.rb
752
759
  - lib/rubocop/cop/style/ip_addresses.rb
753
760
  - lib/rubocop/cop/style/keyword_parameters_order.rb
754
761
  - lib/rubocop/cop/style/lambda.rb
@@ -757,6 +764,7 @@ files:
757
764
  - lib/rubocop/cop/style/magic_comment_format.rb
758
765
  - lib/rubocop/cop/style/map_compact_with_conditional_block.rb
759
766
  - lib/rubocop/cop/style/map_to_hash.rb
767
+ - lib/rubocop/cop/style/map_to_set.rb
760
768
  - lib/rubocop/cop/style/method_call_with_args_parentheses.rb
761
769
  - lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb
762
770
  - lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb
@@ -764,6 +772,7 @@ files:
764
772
  - lib/rubocop/cop/style/method_called_on_do_end_block.rb
765
773
  - lib/rubocop/cop/style/method_def_parentheses.rb
766
774
  - lib/rubocop/cop/style/min_max.rb
775
+ - lib/rubocop/cop/style/min_max_comparison.rb
767
776
  - lib/rubocop/cop/style/missing_else.rb
768
777
  - lib/rubocop/cop/style/missing_respond_to_missing.rb
769
778
  - lib/rubocop/cop/style/mixin_grouping.rb
@@ -821,6 +830,8 @@ files:
821
830
  - lib/rubocop/cop/style/redundant_capital_w.rb
822
831
  - lib/rubocop/cop/style/redundant_condition.rb
823
832
  - lib/rubocop/cop/style/redundant_conditional.rb
833
+ - lib/rubocop/cop/style/redundant_constant_base.rb
834
+ - lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb
824
835
  - lib/rubocop/cop/style/redundant_each.rb
825
836
  - lib/rubocop/cop/style/redundant_exception.rb
826
837
  - lib/rubocop/cop/style/redundant_fetch_block.rb
@@ -840,6 +851,7 @@ files:
840
851
  - lib/rubocop/cop/style/redundant_sort_by.rb
841
852
  - lib/rubocop/cop/style/redundant_string_escape.rb
842
853
  - lib/rubocop/cop/style/regexp_literal.rb
854
+ - lib/rubocop/cop/style/require_order.rb
843
855
  - lib/rubocop/cop/style/rescue_modifier.rb
844
856
  - lib/rubocop/cop/style/rescue_standard_error.rb
845
857
  - lib/rubocop/cop/style/return_nil.rb
@@ -892,6 +904,7 @@ files:
892
904
  - lib/rubocop/cop/style/while_until_modifier.rb
893
905
  - lib/rubocop/cop/style/word_array.rb
894
906
  - lib/rubocop/cop/style/yoda_condition.rb
907
+ - lib/rubocop/cop/style/yoda_expression.rb
895
908
  - lib/rubocop/cop/style/zero_length_predicate.rb
896
909
  - lib/rubocop/cop/team.rb
897
910
  - lib/rubocop/cop/util.rb
@@ -914,6 +927,7 @@ files:
914
927
  - lib/rubocop/ext/regexp_parser.rb
915
928
  - lib/rubocop/feature_loader.rb
916
929
  - lib/rubocop/file_finder.rb
930
+ - lib/rubocop/file_patterns.rb
917
931
  - lib/rubocop/formatter.rb
918
932
  - lib/rubocop/formatter/auto_gen_config_formatter.rb
919
933
  - lib/rubocop/formatter/base_formatter.rb
@@ -985,7 +999,7 @@ metadata:
985
999
  homepage_uri: https://rubocop.org/
986
1000
  changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
987
1001
  source_code_uri: https://github.com/rubocop/rubocop/
988
- documentation_uri: https://docs.rubocop.org/rubocop/1.39/
1002
+ documentation_uri: https://docs.rubocop.org/rubocop/1.44/
989
1003
  bug_tracker_uri: https://github.com/rubocop/rubocop/issues
990
1004
  rubygems_mfa_required: 'true'
991
1005
  post_install_message: