rubocop 1.75.8 → 1.82.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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -16
  3. data/config/default.yml +142 -33
  4. data/config/obsoletion.yml +10 -3
  5. data/exe/rubocop +1 -8
  6. data/lib/rubocop/cli/command/auto_generate_config.rb +2 -2
  7. data/lib/rubocop/cli.rb +20 -4
  8. data/lib/rubocop/comment_config.rb +62 -17
  9. data/lib/rubocop/config_loader.rb +6 -40
  10. data/lib/rubocop/config_loader_resolver.rb +7 -6
  11. data/lib/rubocop/config_store.rb +5 -0
  12. data/lib/rubocop/cop/autocorrect_logic.rb +8 -4
  13. data/lib/rubocop/cop/bundler/ordered_gems.rb +2 -3
  14. data/lib/rubocop/cop/correctors/alignment_corrector.rb +8 -7
  15. data/lib/rubocop/cop/correctors/for_to_each_corrector.rb +7 -2
  16. data/lib/rubocop/cop/correctors/parentheses_corrector.rb +5 -2
  17. data/lib/rubocop/cop/gemspec/attribute_assignment.rb +91 -0
  18. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +0 -22
  19. data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +2 -3
  20. data/lib/rubocop/cop/gemspec/require_mfa.rb +15 -1
  21. data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +10 -5
  22. data/lib/rubocop/cop/internal_affairs/example_description.rb +1 -1
  23. data/lib/rubocop/cop/internal_affairs/location_exists.rb +28 -2
  24. data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +4 -4
  25. data/lib/rubocop/cop/internal_affairs/node_pattern_groups/ast_processor.rb +1 -1
  26. data/lib/rubocop/cop/internal_affairs/node_pattern_groups.rb +4 -1
  27. data/lib/rubocop/cop/internal_affairs/node_type_group.rb +3 -2
  28. data/lib/rubocop/cop/internal_affairs/on_send_without_on_csend.rb +1 -1
  29. data/lib/rubocop/cop/internal_affairs/useless_restrict_on_send.rb +1 -1
  30. data/lib/rubocop/cop/layout/class_structure.rb +1 -1
  31. data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +1 -1
  32. data/lib/rubocop/cop/layout/dot_position.rb +1 -1
  33. data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +3 -0
  34. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +30 -12
  35. data/lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb +101 -0
  36. data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +1 -1
  37. data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +8 -29
  38. data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +1 -1
  39. data/lib/rubocop/cop/layout/end_alignment.rb +4 -0
  40. data/lib/rubocop/cop/layout/hash_alignment.rb +2 -5
  41. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +2 -2
  42. data/lib/rubocop/cop/layout/heredoc_indentation.rb +1 -4
  43. data/lib/rubocop/cop/layout/indentation_style.rb +1 -1
  44. data/lib/rubocop/cop/layout/indentation_width.rb +12 -1
  45. data/lib/rubocop/cop/layout/line_continuation_spacing.rb +1 -1
  46. data/lib/rubocop/cop/layout/line_length.rb +43 -10
  47. data/lib/rubocop/cop/layout/multiline_block_layout.rb +2 -0
  48. data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +5 -1
  49. data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +8 -4
  50. data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +13 -3
  51. data/lib/rubocop/cop/layout/space_after_comma.rb +2 -10
  52. data/lib/rubocop/cop/layout/space_after_semicolon.rb +1 -1
  53. data/lib/rubocop/cop/layout/space_around_keyword.rb +7 -2
  54. data/lib/rubocop/cop/layout/space_around_operators.rb +8 -0
  55. data/lib/rubocop/cop/layout/space_before_brackets.rb +2 -9
  56. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +7 -2
  57. data/lib/rubocop/cop/layout/trailing_whitespace.rb +1 -1
  58. data/lib/rubocop/cop/lint/ambiguous_range.rb +5 -0
  59. data/lib/rubocop/cop/lint/circular_argument_reference.rb +47 -3
  60. data/lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb +3 -2
  61. data/lib/rubocop/cop/lint/cop_directive_syntax.rb +14 -8
  62. data/lib/rubocop/cop/lint/debugger.rb +0 -2
  63. data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +4 -1
  64. data/lib/rubocop/cop/lint/duplicate_match_pattern.rb +4 -4
  65. data/lib/rubocop/cop/lint/duplicate_methods.rb +25 -4
  66. data/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +5 -42
  67. data/lib/rubocop/cop/lint/else_layout.rb +19 -0
  68. data/lib/rubocop/cop/lint/empty_interpolation.rb +14 -1
  69. data/lib/rubocop/cop/lint/float_comparison.rb +4 -4
  70. data/lib/rubocop/cop/lint/identity_comparison.rb +19 -15
  71. data/lib/rubocop/cop/lint/literal_as_condition.rb +38 -28
  72. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
  73. data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +17 -8
  74. data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +4 -0
  75. data/lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb +1 -0
  76. data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +23 -9
  77. data/lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb +1 -1
  78. data/lib/rubocop/cop/lint/redundant_require_statement.rb +4 -2
  79. data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +101 -2
  80. data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +7 -1
  81. data/lib/rubocop/cop/lint/redundant_type_conversion.rb +4 -4
  82. data/lib/rubocop/cop/lint/require_range_parentheses.rb +1 -1
  83. data/lib/rubocop/cop/lint/rescue_exception.rb +1 -4
  84. data/lib/rubocop/cop/lint/rescue_type.rb +1 -1
  85. data/lib/rubocop/cop/lint/safe_navigation_chain.rb +4 -4
  86. data/lib/rubocop/cop/lint/self_assignment.rb +39 -5
  87. data/lib/rubocop/cop/lint/shadowed_argument.rb +7 -7
  88. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +5 -0
  89. data/lib/rubocop/cop/lint/unreachable_code.rb +5 -3
  90. data/lib/rubocop/cop/lint/uri_escape_unescape.rb +2 -0
  91. data/lib/rubocop/cop/lint/useless_access_modifier.rb +29 -4
  92. data/lib/rubocop/cop/lint/useless_assignment.rb +44 -16
  93. data/lib/rubocop/cop/lint/useless_default_value_argument.rb +90 -0
  94. data/lib/rubocop/cop/lint/useless_numeric_operation.rb +1 -0
  95. data/lib/rubocop/cop/lint/useless_or.rb +111 -0
  96. data/lib/rubocop/cop/lint/useless_ruby2_keywords.rb +3 -3
  97. data/lib/rubocop/cop/lint/utils/nil_receiver_checker.rb +121 -0
  98. data/lib/rubocop/cop/lint/void.rb +7 -0
  99. data/lib/rubocop/cop/message_annotator.rb +1 -1
  100. data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +4 -3
  101. data/lib/rubocop/cop/mixin/alignment.rb +1 -1
  102. data/lib/rubocop/cop/mixin/check_line_breakable.rb +1 -1
  103. data/lib/rubocop/cop/mixin/check_single_line_suitability.rb +2 -4
  104. data/lib/rubocop/cop/mixin/code_length.rb +1 -1
  105. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -7
  106. data/lib/rubocop/cop/mixin/frozen_string_literal.rb +1 -1
  107. data/lib/rubocop/cop/mixin/gemspec_help.rb +22 -0
  108. data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +1 -1
  109. data/lib/rubocop/cop/mixin/line_length_help.rb +45 -10
  110. data/lib/rubocop/cop/mixin/method_complexity.rb +1 -1
  111. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
  112. data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +1 -1
  113. data/lib/rubocop/cop/mixin/ordered_gem_node.rb +1 -1
  114. data/lib/rubocop/cop/mixin/space_after_punctuation.rb +5 -4
  115. data/lib/rubocop/cop/mixin/statement_modifier.rb +0 -6
  116. data/lib/rubocop/cop/mixin/trailing_comma.rb +8 -5
  117. data/lib/rubocop/cop/naming/file_name.rb +2 -2
  118. data/lib/rubocop/cop/naming/method_name.rb +129 -13
  119. data/lib/rubocop/cop/naming/predicate_method.rb +319 -0
  120. data/lib/rubocop/cop/naming/{predicate_name.rb → predicate_prefix.rb} +4 -4
  121. data/lib/rubocop/cop/security/eval.rb +2 -1
  122. data/lib/rubocop/cop/security/json_load.rb +33 -11
  123. data/lib/rubocop/cop/security/open.rb +1 -0
  124. data/lib/rubocop/cop/style/access_modifier_declarations.rb +1 -1
  125. data/lib/rubocop/cop/style/accessor_grouping.rb +13 -1
  126. data/lib/rubocop/cop/style/arguments_forwarding.rb +11 -17
  127. data/lib/rubocop/cop/style/array_intersect.rb +99 -35
  128. data/lib/rubocop/cop/style/array_intersect_with_single_element.rb +47 -0
  129. data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -2
  130. data/lib/rubocop/cop/style/bitwise_predicate.rb +8 -1
  131. data/lib/rubocop/cop/style/block_delimiters.rb +1 -1
  132. data/lib/rubocop/cop/style/case_equality.rb +11 -13
  133. data/lib/rubocop/cop/style/case_like_if.rb +1 -1
  134. data/lib/rubocop/cop/style/class_and_module_children.rb +1 -0
  135. data/lib/rubocop/cop/style/collection_querying.rb +167 -0
  136. data/lib/rubocop/cop/style/conditional_assignment.rb +12 -16
  137. data/lib/rubocop/cop/style/constant_visibility.rb +17 -12
  138. data/lib/rubocop/cop/style/dig_chain.rb +1 -1
  139. data/lib/rubocop/cop/style/double_negation.rb +1 -1
  140. data/lib/rubocop/cop/style/empty_method.rb +0 -6
  141. data/lib/rubocop/cop/style/empty_string_inside_interpolation.rb +100 -0
  142. data/lib/rubocop/cop/style/endless_method.rb +15 -2
  143. data/lib/rubocop/cop/style/explicit_block_argument.rb +1 -1
  144. data/lib/rubocop/cop/style/exponential_notation.rb +3 -2
  145. data/lib/rubocop/cop/style/fetch_env_var.rb +32 -6
  146. data/lib/rubocop/cop/style/float_division.rb +15 -1
  147. data/lib/rubocop/cop/style/guard_clause.rb +0 -11
  148. data/lib/rubocop/cop/style/hash_conversion.rb +16 -8
  149. data/lib/rubocop/cop/style/hash_syntax.rb +1 -1
  150. data/lib/rubocop/cop/style/if_unless_modifier.rb +16 -9
  151. data/lib/rubocop/cop/style/infinite_loop.rb +1 -1
  152. data/lib/rubocop/cop/style/inverse_methods.rb +1 -1
  153. data/lib/rubocop/cop/style/it_assignment.rb +69 -12
  154. data/lib/rubocop/cop/style/it_block_parameter.rb +36 -15
  155. data/lib/rubocop/cop/style/map_to_hash.rb +1 -3
  156. data/lib/rubocop/cop/style/map_to_set.rb +1 -3
  157. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +4 -6
  158. data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +12 -1
  159. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +33 -4
  160. data/lib/rubocop/cop/style/min_max_comparison.rb +13 -5
  161. data/lib/rubocop/cop/style/module_member_existence_check.rb +74 -0
  162. data/lib/rubocop/cop/style/multiline_method_signature.rb +2 -4
  163. data/lib/rubocop/cop/style/nil_comparison.rb +9 -7
  164. data/lib/rubocop/cop/style/one_line_conditional.rb +17 -9
  165. data/lib/rubocop/cop/style/operator_method_call.rb +11 -2
  166. data/lib/rubocop/cop/style/parallel_assignment.rb +34 -22
  167. data/lib/rubocop/cop/style/redundant_argument.rb +2 -0
  168. data/lib/rubocop/cop/style/redundant_array_flatten.rb +50 -0
  169. data/lib/rubocop/cop/style/redundant_begin.rb +34 -0
  170. data/lib/rubocop/cop/style/redundant_condition.rb +1 -1
  171. data/lib/rubocop/cop/style/redundant_exception.rb +1 -1
  172. data/lib/rubocop/cop/style/redundant_fetch_block.rb +1 -9
  173. data/lib/rubocop/cop/style/redundant_format.rb +26 -5
  174. data/lib/rubocop/cop/style/redundant_freeze.rb +1 -1
  175. data/lib/rubocop/cop/style/redundant_interpolation.rb +12 -3
  176. data/lib/rubocop/cop/style/redundant_line_continuation.rb +1 -1
  177. data/lib/rubocop/cop/style/redundant_parentheses.rb +55 -16
  178. data/lib/rubocop/cop/style/redundant_percent_q.rb +1 -2
  179. data/lib/rubocop/cop/style/redundant_regexp_argument.rb +9 -0
  180. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +8 -0
  181. data/lib/rubocop/cop/style/redundant_self.rb +8 -5
  182. data/lib/rubocop/cop/style/redundant_sort.rb +7 -7
  183. data/lib/rubocop/cop/style/safe_navigation.rb +44 -12
  184. data/lib/rubocop/cop/style/semicolon.rb +23 -7
  185. data/lib/rubocop/cop/style/single_line_methods.rb +7 -4
  186. data/lib/rubocop/cop/style/sole_nested_conditional.rb +40 -3
  187. data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +1 -1
  188. data/lib/rubocop/cop/style/string_concatenation.rb +17 -13
  189. data/lib/rubocop/cop/style/super_arguments.rb +2 -2
  190. data/lib/rubocop/cop/style/symbol_array.rb +1 -1
  191. data/lib/rubocop/cop/style/symbol_proc.rb +1 -1
  192. data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +45 -0
  193. data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +1 -1
  194. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +11 -11
  195. data/lib/rubocop/cop/style/unless_else.rb +10 -9
  196. data/lib/rubocop/cop/util.rb +2 -3
  197. data/lib/rubocop/cop/utils/format_string.rb +10 -0
  198. data/lib/rubocop/cop/variable_force/variable.rb +1 -1
  199. data/lib/rubocop/cop/variable_force.rb +25 -8
  200. data/lib/rubocop/cops_documentation_generator.rb +5 -4
  201. data/lib/rubocop/directive_comment.rb +46 -3
  202. data/lib/rubocop/formatter/disabled_config_formatter.rb +19 -5
  203. data/lib/rubocop/formatter/fuubar_style_formatter.rb +1 -1
  204. data/lib/rubocop/formatter/markdown_formatter.rb +1 -0
  205. data/lib/rubocop/formatter/offense_count_formatter.rb +1 -1
  206. data/lib/rubocop/formatter/pacman_formatter.rb +1 -0
  207. data/lib/rubocop/lsp/diagnostic.rb +14 -18
  208. data/lib/rubocop/lsp/routes.rb +35 -6
  209. data/lib/rubocop/lsp/stdin_runner.rb +0 -16
  210. data/lib/rubocop/magic_comment.rb +20 -0
  211. data/lib/rubocop/pending_cops_reporter.rb +56 -0
  212. data/lib/rubocop/rake_task.rb +1 -1
  213. data/lib/rubocop/remote_config.rb +7 -8
  214. data/lib/rubocop/result_cache.rb +51 -38
  215. data/lib/rubocop/rspec/expect_offense.rb +9 -3
  216. data/lib/rubocop/rspec/shared_contexts.rb +2 -2
  217. data/lib/rubocop/rspec/support.rb +1 -1
  218. data/lib/rubocop/runner.rb +10 -4
  219. data/lib/rubocop/server/cache.rb +4 -2
  220. data/lib/rubocop/server/client_command/base.rb +10 -0
  221. data/lib/rubocop/server/client_command/exec.rb +2 -1
  222. data/lib/rubocop/server/client_command/start.rb +11 -1
  223. data/lib/rubocop/target_finder.rb +9 -9
  224. data/lib/rubocop/target_ruby.rb +11 -2
  225. data/lib/rubocop/version.rb +1 -1
  226. data/lib/rubocop.rb +13 -1
  227. data/lib/ruby_lsp/rubocop/addon.rb +25 -10
  228. data/lib/ruby_lsp/rubocop/runtime_adapter.rb +49 -15
  229. metadata +20 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31a9b16f521cb4dd8d22db58d5473cd527162b65934d8e210993f7c435a85d26
4
- data.tar.gz: 57af5692e8b85aca41224e621a0ba6b54001944a6625edef169a78278066a532
3
+ metadata.gz: 9dfdd0a2943006435a98725498ab85032b82d1cff547cd0bed007a250e56aca4
4
+ data.tar.gz: c6a9e601a1e7858282d835dc00cd0f065ab3bc43de633988877dae6422f85f71
5
5
  SHA512:
6
- metadata.gz: ef0ab376b3993e9ad1961560911ed5b5e2abf069a2b9acd0187e3d31c03f853a520646f2c421813bc3c03aedd74004dcf057cbadecad0ea86acafbd6670c8e46
7
- data.tar.gz: b76bd8b4d7492577429bab8abd02ebcf7f2d9d2f83066e81c48b060abcaad68a2660b064c1f5b0b9c42bc80cc78ce15cd6e10ace393cd636310055515af925db
6
+ metadata.gz: e19cc58194cf953813d3e3bf0d3bfa7d976f30127008ba84473b08cdcba188a4f73ac102baea188dfa463723b15fc768a3b7152306d5fcb5a5b7b7265e031ad2
7
+ data.tar.gz: 26ed5927b0b375947c553a46434c6a58a63022c928b84b03ff1b44a8a74eee6c8cb29342262df28fcca223e194257d7e9fe7a06fb422d42e0805287380830743
data/README.md CHANGED
@@ -6,8 +6,6 @@
6
6
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
7
7
  [![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
8
8
  [![CI](https://github.com/rubocop/rubocop/actions/workflows/rubocop.yml/badge.svg)](https://github.com/rubocop/rubocop/actions/workflows/rubocop.yml)
9
- [![Test Coverage](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/test_coverage)](https://codeclimate.com/github/rubocop/rubocop/test_coverage)
10
- [![Maintainability](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/maintainability)](https://codeclimate.com/github/rubocop/rubocop/maintainability)
11
9
  [![Discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg?sanitize=true)](https://discord.gg/wJjWvGRDmm)
12
10
 
13
11
  > Role models are important. <br/>
@@ -36,10 +34,11 @@ Working on RuboCop is often fun, but it also requires a great deal of time and e
36
34
  **RuboCop**'s installation is pretty standard:
37
35
 
38
36
  ```sh
39
- $ gem install rubocop
37
+ gem install rubocop
40
38
  ```
41
39
 
42
- If you'd rather install RuboCop using `bundler`, add a line for it in your `Gemfile` (but set the `require` option to `false`, as it is a standalone tool):
40
+ If you'd rather install RuboCop using `bundler`, add a line for it in your
41
+ `Gemfile` (but set the `require` option to `false`, as it is a standalone tool):
43
42
 
44
43
  ```rb
45
44
  gem 'rubocop', require: false
@@ -52,7 +51,7 @@ To prevent an unwanted RuboCop update you might want to use a conservative versi
52
51
  in your `Gemfile`:
53
52
 
54
53
  ```rb
55
- gem 'rubocop', '~> 1.75', require: false
54
+ gem 'rubocop', '~> 1.82', require: false
56
55
  ```
57
56
 
58
57
  See [our versioning policy](https://docs.rubocop.org/rubocop/versioning.html) for further details.
@@ -61,12 +60,15 @@ See [our versioning policy](https://docs.rubocop.org/rubocop/versioning.html) fo
61
60
 
62
61
  Just type `rubocop` in a Ruby project's folder and watch the magic happen.
63
62
 
64
- ```
65
- $ cd my/cool/ruby/project
66
- $ rubocop
63
+ ```sh
64
+ cd my/cool/ruby/project
65
+ rubocop
67
66
  ```
68
67
 
69
- You can also use this magic in your favorite editor with RuboCop's [built-in LSP server](https://docs.rubocop.org/rubocop/usage/lsp.html).
68
+ > [!TIP]
69
+ >
70
+ > You can also use this magic in your favorite editor with RuboCop's
71
+ > [built-in LSP server](https://docs.rubocop.org/rubocop/usage/lsp.html).
70
72
 
71
73
  ## Documentation
72
74
 
@@ -79,7 +81,7 @@ RuboCop officially supports the following runtime Ruby implementations:
79
81
  * MRI 2.7+
80
82
  * JRuby 9.4+
81
83
 
82
- Targets Ruby 2.0+ code analysis.
84
+ It targets Ruby 2.0+ for code analysis.
83
85
 
84
86
  See the [compatibility documentation](https://docs.rubocop.org/rubocop/compatibility.html) for further details.
85
87
 
@@ -91,7 +93,6 @@ If you use RuboCop in your project, you can include one of these badges in your
91
93
 
92
94
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://rubystyle.guide)
93
95
 
94
-
95
96
  Here are the Markdown snippets for the two badges:
96
97
 
97
98
  ``` markdown
@@ -109,7 +110,7 @@ Here's a list of RuboCop's core developers:
109
110
  * [Yuji Nakayama](https://github.com/yujinakayama) (retired)
110
111
  * [Evgeni Dzhelyov](https://github.com/edzhelyov) (retired)
111
112
  * [Ted Johansson](https://github.com/drenmi)
112
- * [Masataka Kuwabara](https://github.com/pocke)
113
+ * [Masataka Kuwabara](https://github.com/pocke) (retired)
113
114
  * [Koichi Ito](https://github.com/koic)
114
115
  * [Maxim Krizhanovski](https://github.com/darhazer)
115
116
  * [Benjamin Quorning](https://github.com/bquorning)
@@ -157,8 +158,8 @@ wide array of funding channels to account for your preferences
157
158
  currently [Open Collective](https://opencollective.com/rubocop) is our
158
159
  preferred funding platform).
159
160
 
160
- **If you're working in a company that's making significant use of RuboCop we'd appreciate it if you suggest to your company
161
- to become a RuboCop sponsor.**
161
+ **If you're working in a company that's making significant use of RuboCop we'd
162
+ appreciate it if you suggest to your company to become a RuboCop sponsor.**
162
163
 
163
164
  You can support the development of RuboCop via
164
165
  [GitHub Sponsors](https://github.com/sponsors/bbatsov),
@@ -168,8 +169,11 @@ You can support the development of RuboCop via
168
169
  and [Tidelift](https://tidelift.com/subscription/pkg/rubygems-rubocop?utm_source=rubygems-rubocop&utm_medium=referral&utm_campaign=readme)
169
170
  .
170
171
 
171
- **Note:** If doing a sponsorship in the form of donation is problematic for your company from an accounting standpoint, we'd recommend
172
- the use of Tidelift, where you can get a support-like subscription instead.
172
+ > [!NOTE]
173
+ >
174
+ > If doing a sponsorship in the form of donation is problematic for your company
175
+ > from an accounting standpoint, we'd recommend the use of Tidelift, where you
176
+ > can get a support-like subscription instead.
173
177
 
174
178
  ### Open Collective for Individuals
175
179
 
data/config/default.yml CHANGED
@@ -275,12 +275,19 @@ Gemspec/AddRuntimeDependency:
275
275
  Description: 'Prefer `add_dependency` over `add_runtime_dependency`.'
276
276
  StyleGuide: '#add_dependency_vs_add_runtime_dependency'
277
277
  References:
278
- - https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316
278
+ - https://github.com/ruby/rubygems/issues/7799#issuecomment-2192720316
279
279
  Enabled: pending
280
280
  VersionAdded: '1.65'
281
281
  Include:
282
282
  - '**/*.gemspec'
283
283
 
284
+ Gemspec/AttributeAssignment:
285
+ Description: 'Use consistent style for Gemspec attributes assignment.'
286
+ Enabled: pending
287
+ VersionAdded: '1.77'
288
+ Include:
289
+ - '**/*.gemspec'
290
+
284
291
  Gemspec/DependencyVersion:
285
292
  Description: 'Requires or forbids specifying gem dependency versions.'
286
293
  Enabled: false
@@ -371,7 +378,7 @@ Gemspec/RubyVersionGlobalsUsage:
371
378
  #################### Layout ###########################
372
379
 
373
380
  Layout/AccessModifierIndentation:
374
- Description: Check indentation of private/protected visibility modifiers.
381
+ Description: Checks indentation of private/protected visibility modifiers.
375
382
  StyleGuide: '#indent-public-private-protected'
376
383
  Enabled: true
377
384
  VersionAdded: '0.49'
@@ -631,6 +638,12 @@ Layout/EmptyLines:
631
638
  Enabled: true
632
639
  VersionAdded: '0.49'
633
640
 
641
+ Layout/EmptyLinesAfterModuleInclusion:
642
+ Description: 'Keeps track of empty lines after module inclusion methods.'
643
+ StyleGuide: '#empty-lines-after-module-inclusion'
644
+ Enabled: pending
645
+ VersionAdded: '1.79'
646
+
634
647
  Layout/EmptyLinesAroundAccessModifier:
635
648
  Description: "Keep blank lines around access modifiers."
636
649
  StyleGuide: '#empty-lines-around-access-modifier'
@@ -1044,7 +1057,7 @@ Layout/LeadingCommentSpace:
1044
1057
  AllowSteepAnnotation: false
1045
1058
 
1046
1059
  Layout/LeadingEmptyLines:
1047
- Description: Check for unnecessary blank lines at the beginning of a file.
1060
+ Description: Checks for unnecessary blank lines at the beginning of a file.
1048
1061
  Enabled: true
1049
1062
  VersionAdded: '0.57'
1050
1063
  VersionChanged: '0.77'
@@ -1089,18 +1102,22 @@ Layout/LineLength:
1089
1102
  StyleGuide: '#max-line-length'
1090
1103
  Enabled: true
1091
1104
  VersionAdded: '0.25'
1092
- VersionChanged: '1.69'
1105
+ VersionChanged: '1.82'
1093
1106
  Max: 120
1094
1107
  AllowHeredoc: true
1095
1108
  # To make it possible to copy or click on URIs in the code, we allow lines
1096
1109
  # containing a URI to be longer than Max.
1097
1110
  AllowURI: true
1111
+ AllowQualifiedName: true
1098
1112
  URISchemes:
1099
1113
  - http
1100
1114
  - https
1101
- # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1115
+ # The AllowRBSInlineAnnotation option makes LineLength allow RBS::Inline annotations
1116
+ # such as `#: (?date: Date) -> Foo` when calculating line length.
1117
+ AllowRBSInlineAnnotation: false
1118
+ # The AllowCopDirectives option causes the LineLength rule to ignore cop
1102
1119
  # directives like '# rubocop: enable ...' when calculating a line's length.
1103
- IgnoreCopDirectives: true
1120
+ AllowCopDirectives: true
1104
1121
  # The AllowedPatterns option is a list of !ruby/regexp and/or string
1105
1122
  # elements. Strings will be converted to Regexp objects. A line that matches
1106
1123
  # any regular expression listed in this option will be ignored by LineLength.
@@ -1133,7 +1150,7 @@ Layout/MultilineArrayLineBreaks:
1133
1150
  AllowMultilineFinalElement: false
1134
1151
 
1135
1152
  Layout/MultilineAssignmentLayout:
1136
- Description: 'Check for a newline after the assignment operator in multi-line assignments.'
1153
+ Description: 'Checks for a newline after the assignment operator in multi-line assignments.'
1137
1154
  StyleGuide: '#indent-conditional-assignment'
1138
1155
  Enabled: false
1139
1156
  VersionAdded: '0.49'
@@ -1647,7 +1664,7 @@ Lint/BinaryOperatorWithIdenticalOperands:
1647
1664
  VersionChanged: '1.69'
1648
1665
 
1649
1666
  Lint/BooleanSymbol:
1650
- Description: 'Check for `:true` and `:false` symbols.'
1667
+ Description: 'Checks for `:true` and `:false` symbols.'
1651
1668
  Enabled: true
1652
1669
  SafeAutoCorrect: false
1653
1670
  VersionAdded: '0.50'
@@ -1680,7 +1697,7 @@ Lint/ConstantReassignment:
1680
1697
  VersionAdded: '1.70'
1681
1698
 
1682
1699
  Lint/ConstantResolution:
1683
- Description: 'Check that constants are fully qualified with `::`.'
1700
+ Description: 'Checks that constants are fully qualified with `::`.'
1684
1701
  Enabled: false
1685
1702
  VersionAdded: '0.86'
1686
1703
  # Restrict this cop to only looking at certain names
@@ -1694,7 +1711,7 @@ Lint/CopDirectiveSyntax:
1694
1711
  VersionAdded: '1.72'
1695
1712
 
1696
1713
  Lint/Debugger:
1697
- Description: 'Check for debugger calls.'
1714
+ Description: 'Checks for debugger calls.'
1698
1715
  Enabled: true
1699
1716
  VersionAdded: '0.14'
1700
1717
  VersionChanged: '1.63'
@@ -1745,7 +1762,7 @@ Lint/Debugger:
1745
1762
  - debug/start
1746
1763
 
1747
1764
  Lint/DeprecatedClassMethods:
1748
- Description: 'Check for deprecated class method calls.'
1765
+ Description: 'Checks for deprecated class method calls.'
1749
1766
  Enabled: true
1750
1767
  VersionAdded: '0.19'
1751
1768
 
@@ -1819,13 +1836,13 @@ Lint/DuplicateElsifCondition:
1819
1836
  VersionAdded: '0.88'
1820
1837
 
1821
1838
  Lint/DuplicateHashKey:
1822
- Description: 'Check for duplicate keys in hash literals.'
1839
+ Description: 'Checks for duplicate keys in hash literals.'
1823
1840
  Enabled: true
1824
1841
  VersionAdded: '0.34'
1825
1842
  VersionChanged: '0.77'
1826
1843
 
1827
1844
  Lint/DuplicateMagicComment:
1828
- Description: 'Check for duplicated magic comments.'
1845
+ Description: 'Checks for duplicated magic comments.'
1829
1846
  Enabled: pending
1830
1847
  VersionAdded: '1.37'
1831
1848
 
@@ -1835,7 +1852,7 @@ Lint/DuplicateMatchPattern:
1835
1852
  VersionAdded: '1.50'
1836
1853
 
1837
1854
  Lint/DuplicateMethods:
1838
- Description: 'Check for duplicate method definitions.'
1855
+ Description: 'Checks for duplicate method definitions.'
1839
1856
  Enabled: true
1840
1857
  VersionAdded: '0.29'
1841
1858
 
@@ -1845,7 +1862,7 @@ Lint/DuplicateRegexpCharacterClassElement:
1845
1862
  VersionAdded: '1.1'
1846
1863
 
1847
1864
  Lint/DuplicateRequire:
1848
- Description: 'Check for duplicate `require`s and `require_relative`s.'
1865
+ Description: 'Checks for duplicate `require`s and `require_relative`s.'
1849
1866
  Enabled: true
1850
1867
  SafeAutoCorrect: false
1851
1868
  VersionAdded: '0.90'
@@ -1862,12 +1879,12 @@ Lint/DuplicateSetElement:
1862
1879
  VersionAdded: '1.67'
1863
1880
 
1864
1881
  Lint/EachWithObjectArgument:
1865
- Description: 'Check for immutable argument given to each_with_object.'
1882
+ Description: 'Checks for immutable argument given to each_with_object.'
1866
1883
  Enabled: true
1867
1884
  VersionAdded: '0.31'
1868
1885
 
1869
1886
  Lint/ElseLayout:
1870
- Description: 'Check for odd code arrangement in an else block.'
1887
+ Description: 'Checks for odd code arrangement in an else block.'
1871
1888
  Enabled: true
1872
1889
  VersionAdded: '0.17'
1873
1890
  VersionChanged: '1.2'
@@ -1923,7 +1940,7 @@ Lint/EmptyInterpolation:
1923
1940
  Enabled: true
1924
1941
  AutoCorrect: contextual
1925
1942
  VersionAdded: '0.20'
1926
- VersionChanged: '1.61'
1943
+ VersionChanged: '1.76'
1927
1944
 
1928
1945
  Lint/EmptyWhen:
1929
1946
  Description: 'Checks for `when` branches with empty bodies.'
@@ -2270,6 +2287,7 @@ Lint/RedundantSafeNavigation:
2270
2287
  Description: 'Checks for redundant safe navigation calls.'
2271
2288
  Enabled: true
2272
2289
  VersionAdded: '0.93'
2290
+ VersionChanged: '1.79'
2273
2291
  AllowedMethods:
2274
2292
  - instance_of?
2275
2293
  - kind_of?
@@ -2277,6 +2295,12 @@ Lint/RedundantSafeNavigation:
2277
2295
  - eql?
2278
2296
  - respond_to?
2279
2297
  - equal?
2298
+ InferNonNilReceiver: false
2299
+ AdditionalNilMethods:
2300
+ - present?
2301
+ - blank?
2302
+ - try
2303
+ - try!
2280
2304
  Safe: false
2281
2305
 
2282
2306
  Lint/RedundantSplatExpansion:
@@ -2400,6 +2424,7 @@ Lint/SelfAssignment:
2400
2424
  Description: 'Checks for self-assignments.'
2401
2425
  Enabled: true
2402
2426
  VersionAdded: '0.89'
2427
+ AllowRBSInlineAnnotation: false
2403
2428
 
2404
2429
  Lint/SendWithMixinArgument:
2405
2430
  Description: 'Checks for `send` method when using mixin.'
@@ -2423,8 +2448,9 @@ Lint/ShadowingOuterLocalVariable:
2423
2448
  Description: >-
2424
2449
  Do not use the same name as outer local variable
2425
2450
  for block arguments or block local variables.
2426
- Enabled: true
2451
+ Enabled: false
2427
2452
  VersionAdded: '0.9'
2453
+ VersionChanged: '1.76'
2428
2454
 
2429
2455
  Lint/SharedMutableDefault:
2430
2456
  Description: 'Checks for mutable literals used as default arguments during Hash initialization.'
@@ -2612,6 +2638,13 @@ Lint/UselessConstantScoping:
2612
2638
  Enabled: pending
2613
2639
  VersionAdded: '1.72'
2614
2640
 
2641
+ Lint/UselessDefaultValueArgument:
2642
+ Description: 'Checks for usage of `fetch` or `Array.new` with default value argument and block.'
2643
+ Enabled: pending
2644
+ VersionAdded: '1.76'
2645
+ Safe: false
2646
+ AllowedReceivers: []
2647
+
2615
2648
  Lint/UselessDefined:
2616
2649
  Description: 'Checks for calls to `defined?` with strings and symbols. The result of such a call will always be truthy.'
2617
2650
  Enabled: pending
@@ -2636,6 +2669,14 @@ Lint/UselessNumericOperation:
2636
2669
  Enabled: pending
2637
2670
  VersionAdded: '1.66'
2638
2671
 
2672
+ Lint/UselessOr:
2673
+ Description: 'Checks for useless OR expressions.'
2674
+ Enabled: pending
2675
+ SafeAutoCorrect: false
2676
+ AutoCorrect: contextual
2677
+ VersionAdded: '1.76'
2678
+ VersionChanged: '1.82'
2679
+
2639
2680
  Lint/UselessRescue:
2640
2681
  Description: 'Checks for useless `rescue`s.'
2641
2682
  Enabled: pending
@@ -2676,7 +2717,7 @@ Metrics/AbcSize:
2676
2717
  A calculated magnitude based on number of assignments,
2677
2718
  branches, and conditions.
2678
2719
  References:
2679
- - http://c2.com/cgi/wiki?AbcMetric
2720
+ - https://wiki.c2.com/?AbcMetric
2680
2721
  - https://en.wikipedia.org/wiki/ABC_Software_Metric
2681
2722
  Enabled: true
2682
2723
  VersionAdded: '0.27'
@@ -2795,7 +2836,7 @@ Migration/DepartmentName:
2795
2836
  #################### Naming ##############################
2796
2837
 
2797
2838
  Naming/AccessorMethodName:
2798
- Description: Check the naming of accessor methods for get_/set_.
2839
+ Description: Checks the naming of accessor methods for get_/set_.
2799
2840
  StyleGuide: '#accessor_mutator_method_names'
2800
2841
  Enabled: true
2801
2842
  VersionAdded: '0.50'
@@ -3046,8 +3087,26 @@ Naming/MethodParameterName:
3046
3087
  # Forbidden names that will register an offense
3047
3088
  ForbiddenNames: []
3048
3089
 
3049
- Naming/PredicateName:
3050
- Description: 'Check the names of predicate methods.'
3090
+ Naming/PredicateMethod:
3091
+ Description: 'Checks that predicate methods end with `?` and non-predicate methods do not.'
3092
+ Enabled: pending
3093
+ VersionAdded: '1.76'
3094
+ VersionChanged: '1.78'
3095
+ # In `aggressive` mode, the cop will register an offense for predicate methods that
3096
+ # may return a non-boolean value.
3097
+ # In `conservative` mode, the cop will *not* register an offense for predicate methods
3098
+ # that may return a non-boolean value.
3099
+ Mode: conservative
3100
+ AllowedMethods:
3101
+ - call
3102
+ AllowedPatterns: []
3103
+ AllowBangMethods: false
3104
+ # Methods that are known to not return a boolean value, despite ending in `?`.
3105
+ WaywardPredicates:
3106
+ - nonzero?
3107
+
3108
+ Naming/PredicatePrefix:
3109
+ Description: 'Predicate method names should not be prefixed and end with a `?`.'
3051
3110
  StyleGuide: '#bool-methods-qmark'
3052
3111
  Enabled: true
3053
3112
  VersionAdded: '0.50'
@@ -3154,6 +3213,7 @@ Security/JSONLoad:
3154
3213
  security issues. See reference for more information.
3155
3214
  References:
3156
3215
  - 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
3216
+ - 'https://bugs.ruby-lang.org/issues/19528'
3157
3217
  Enabled: true
3158
3218
  VersionAdded: '0.43'
3159
3219
  VersionChanged: '1.22'
@@ -3227,7 +3287,7 @@ Style/Alias:
3227
3287
 
3228
3288
  Style/AmbiguousEndlessMethodDefinition:
3229
3289
  Description: 'Checks for endless methods inside operators of lower precedence.'
3230
- StyleGuide: '#ambiguous-endless-method-defintions'
3290
+ StyleGuide: '#ambiguous-endless-method-definitions'
3231
3291
  Enabled: pending
3232
3292
  VersionAdded: '1.68'
3233
3293
 
@@ -3288,6 +3348,12 @@ Style/ArrayIntersect:
3288
3348
  Safe: false
3289
3349
  VersionAdded: '1.40'
3290
3350
 
3351
+ Style/ArrayIntersectWithSingleElement:
3352
+ Description: 'Use `include?(element)` instead of `intersect?([element])`.'
3353
+ Enabled: 'pending'
3354
+ Safe: false
3355
+ VersionAdded: '1.81'
3356
+
3291
3357
  Style/ArrayJoin:
3292
3358
  Description: 'Use Array#join instead of Array#*.'
3293
3359
  StyleGuide: '#array-join'
@@ -3465,9 +3531,11 @@ Style/BlockDelimiters:
3465
3531
  BracesRequiredMethods: []
3466
3532
 
3467
3533
  Style/CaseEquality:
3468
- Description: 'Avoid explicit use of the case equality operator(===).'
3534
+ Description: 'Avoid explicit use of the case equality operator (`===`).'
3469
3535
  StyleGuide: '#no-case-equality'
3470
3536
  Enabled: true
3537
+ References:
3538
+ - 'https://docs.rubocop.org/rubocop-performance/cops_performance.html#performanceregexpmatch'
3471
3539
  VersionAdded: '0.9'
3472
3540
  VersionChanged: '0.89'
3473
3541
  # If `AllowOnConstant` option is enabled, the cop will ignore violations when the receiver of
@@ -3632,6 +3700,13 @@ Style/CollectionMethods:
3632
3700
  - inject
3633
3701
  - reduce
3634
3702
 
3703
+ Style/CollectionQuerying:
3704
+ Description: 'Prefer `Enumerable` predicate methods over expressions with `count`.'
3705
+ StyleGuide: '#collection-querying'
3706
+ Enabled: pending
3707
+ VersionAdded: '1.77'
3708
+ Safe: false
3709
+
3635
3710
  Style/ColonMethodCall:
3636
3711
  Description: 'Do not use :: for method call.'
3637
3712
  StyleGuide: '#double-colons'
@@ -3939,6 +4014,16 @@ Style/EmptyMethod:
3939
4014
  - compact
3940
4015
  - expanded
3941
4016
 
4017
+ Style/EmptyStringInsideInterpolation:
4018
+ Description: 'Checks for empty strings being assigned inside string interpolation.'
4019
+ StyleGuide: '#empty-strings-in-interpolation'
4020
+ Enabled: pending
4021
+ EnforcedStyle: trailing_conditional
4022
+ SupportedStyles:
4023
+ - trailing_conditional
4024
+ - ternary
4025
+ VersionAdded: '1.76'
4026
+
3942
4027
  Style/Encoding:
3943
4028
  Description: 'Use UTF-8 as the source file encoding.'
3944
4029
  StyleGuide: '#utf-8'
@@ -4023,6 +4108,9 @@ Style/FetchEnvVar:
4023
4108
  VersionAdded: '1.28'
4024
4109
  # Environment variables to be excluded from the inspection.
4025
4110
  AllowedVars: []
4111
+ # When `true`, autocorrects `ENV["key"]` to `ENV.fetch("key", nil)`.
4112
+ # When `false`, autocorrects `ENV["key"]` to `ENV.fetch("key")`.
4113
+ DefaultToNil: true
4026
4114
 
4027
4115
  Style/FileEmpty:
4028
4116
  Description: >-
@@ -4164,7 +4252,7 @@ Style/GlobalVars:
4164
4252
  AllowedVariables: []
4165
4253
 
4166
4254
  Style/GuardClause:
4167
- Description: 'Check for conditionals that can be replaced with guard clauses.'
4255
+ Description: 'Checks for conditionals that can be replaced with guard clauses.'
4168
4256
  StyleGuide: '#no-nested-conditionals'
4169
4257
  Enabled: true
4170
4258
  VersionAdded: '0.20'
@@ -4426,19 +4514,21 @@ Style/IpAddresses:
4426
4514
  - '**/*.gemspec'
4427
4515
 
4428
4516
  Style/ItAssignment:
4429
- Description: 'Checks for assignment to `it` inside a block.'
4517
+ Description: 'Checks for local variables and method parameters named `it`.'
4430
4518
  Enabled: pending
4431
4519
  VersionAdded: '1.70'
4432
4520
 
4433
4521
  Style/ItBlockParameter:
4434
4522
  Description: 'Checks for blocks with one argument where `it` block parameter can be used.'
4435
4523
  Enabled: pending
4436
- EnforcedStyle: only_numbered_parameters
4524
+ EnforcedStyle: allow_single_line
4437
4525
  SupportedStyles:
4526
+ - allow_single_line
4438
4527
  - only_numbered_parameters
4439
4528
  - always
4440
4529
  - disallow
4441
4530
  VersionAdded: '1.75'
4531
+ VersionChanged: '1.76'
4442
4532
 
4443
4533
  Style/KeywordArgumentsMerging:
4444
4534
  Description: >-
@@ -4471,8 +4561,9 @@ Style/LambdaCall:
4471
4561
  Description: 'Use lambda.call(...) instead of lambda.(...).'
4472
4562
  StyleGuide: '#proc-call'
4473
4563
  Enabled: true
4564
+ AutoCorrect: contextual
4474
4565
  VersionAdded: '0.13'
4475
- VersionChanged: '0.14'
4566
+ VersionChanged: '1.81'
4476
4567
  EnforcedStyle: call
4477
4568
  SupportedStyles:
4478
4569
  - call
@@ -4542,6 +4633,7 @@ Style/MethodCallWithArgsParentheses:
4542
4633
  AllowedMethods: []
4543
4634
  AllowedPatterns: []
4544
4635
  IncludedMacros: []
4636
+ IncludedMacroPatterns: []
4545
4637
  AllowParenthesesInMultilineCall: false
4546
4638
  AllowParenthesesInChaining: false
4547
4639
  AllowParenthesesInCamelCaseMethod: false
@@ -4652,6 +4744,11 @@ Style/ModuleFunction:
4652
4744
  Autocorrect: false
4653
4745
  SafeAutoCorrect: false
4654
4746
 
4747
+ Style/ModuleMemberExistenceCheck:
4748
+ Description: 'Checks for usage of `Module` methods returning arrays that can be replaced with equivalent predicates.'
4749
+ Enabled: pending
4750
+ VersionAdded: '1.82'
4751
+
4655
4752
  Style/MultilineBlockChain:
4656
4753
  Description: 'Avoid multi-line chains of blocks.'
4657
4754
  StyleGuide: '#single-line-blocks'
@@ -4969,7 +5066,7 @@ Style/OpenStructUse:
4969
5066
  Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
4970
5067
  version compatibility, and potential security issues.
4971
5068
  References:
4972
- - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats
5069
+ - https://docs.ruby-lang.org/en/3.0/OpenStruct.html#class-OpenStruct-label-Caveats
4973
5070
 
4974
5071
  Enabled: pending
4975
5072
  Safe: false
@@ -5125,7 +5222,7 @@ Style/RandomWithOffset:
5125
5222
  VersionAdded: '0.52'
5126
5223
 
5127
5224
  Style/RedundantArgument:
5128
- Description: 'Check for a redundant argument passed to certain methods.'
5225
+ Description: 'Checks for a redundant argument passed to certain methods.'
5129
5226
  Enabled: pending
5130
5227
  Safe: false
5131
5228
  VersionAdded: '1.4'
@@ -5139,6 +5236,8 @@ Style/RedundantArgument:
5139
5236
  exit: true
5140
5237
  # Kernel.#exit!
5141
5238
  exit!: false
5239
+ # String#to_i
5240
+ to_i: 10
5142
5241
  # String#split
5143
5242
  split: ' '
5144
5243
  # String#chomp
@@ -5151,6 +5250,12 @@ Style/RedundantArrayConstructor:
5151
5250
  Enabled: pending
5152
5251
  VersionAdded: '1.52'
5153
5252
 
5253
+ Style/RedundantArrayFlatten:
5254
+ Description: 'Checks for redundant calls of `Array#flatten`.'
5255
+ Enabled: pending
5256
+ Safe: false
5257
+ VersionAdded: '1.76'
5258
+
5154
5259
  Style/RedundantAssignment:
5155
5260
  Description: 'Checks for redundant assignment before returning.'
5156
5261
  Enabled: true
@@ -5280,7 +5385,7 @@ Style/RedundantInterpolationUnfreeze:
5280
5385
  VersionAdded: '1.66'
5281
5386
 
5282
5387
  Style/RedundantLineContinuation:
5283
- Description: 'Check for redundant line continuation.'
5388
+ Description: 'Checks for redundant line continuation.'
5284
5389
  Enabled: pending
5285
5390
  VersionAdded: '1.49'
5286
5391
 
@@ -5574,7 +5679,7 @@ Style/SpecialGlobalVars:
5574
5679
  - use_builtin_english_names
5575
5680
 
5576
5681
  Style/StabbyLambdaParentheses:
5577
- Description: 'Check for the usage of parentheses around stabby lambda arguments.'
5682
+ Description: 'Checks for the usage of parentheses around stabby lambda arguments.'
5578
5683
  StyleGuide: '#stabby-lambda-with-args'
5579
5684
  Enabled: true
5580
5685
  VersionAdded: '0.35'
@@ -5763,10 +5868,14 @@ Style/TrailingCommaInArguments:
5763
5868
  # parenthesized method calls where each argument is on its own line.
5764
5869
  # If `consistent_comma`, the cop requires a comma after the last argument,
5765
5870
  # for all parenthesized method calls with arguments.
5871
+ # If `diff_comma`, the cop requires a comma after the last argument, but only
5872
+ # when that argument is followed by an immediate newline, even if
5873
+ # there is an inline comment.
5766
5874
  EnforcedStyleForMultiline: no_comma
5767
5875
  SupportedStylesForMultiline:
5768
5876
  - comma
5769
5877
  - consistent_comma
5878
+ - diff_comma
5770
5879
  - no_comma
5771
5880
 
5772
5881
  Style/TrailingCommaInArrayLiteral:
@@ -31,6 +31,9 @@ renamed:
31
31
  Lint/UnneededRequireStatement: Lint/RedundantRequireStatement
32
32
  Lint/UnneededSplatExpansion: Lint/RedundantSplatExpansion
33
33
  Metrics/LineLength: Layout/LineLength
34
+ Naming/PredicateName:
35
+ new_name: Naming/PredicatePrefix
36
+ severity: warning
34
37
  Naming/UncommunicativeBlockParamName: Naming/BlockParameterName
35
38
  Naming/UncommunicativeMethodParamName: Naming/MethodParameterName
36
39
  Style/AccessorMethodName: Naming/AccessorMethodName
@@ -44,7 +47,7 @@ renamed:
44
47
  Style/MethodName: Naming/MethodName
45
48
  Style/OpMethod: Naming/BinaryOperatorParameterName
46
49
  Style/PredicateName:
47
- new_name: Naming/PredicateName
50
+ new_name: Naming/PredicatePrefix
48
51
  severity: warning
49
52
  Style/SingleSpaceBeforeFirstArg: Layout/SpaceBeforeFirstArg
50
53
  Style/UnneededCapitalW: Style/RedundantCapitalW
@@ -142,6 +145,10 @@ changed_parameters:
142
145
  - cops: Layout/CaseIndentation
143
146
  parameters: IndentWhenRelativeTo
144
147
  alternative: EnforcedStyle
148
+ - cops: Layout/LineLength
149
+ parameters: IgnoreCopDirectives
150
+ alternative: AllowCopDirectives
151
+ severity: warning
145
152
  - cops:
146
153
  - Lint/BlockAlignment
147
154
  - Layout/BlockAlignment
@@ -179,10 +186,10 @@ changed_parameters:
179
186
  - cops: Naming/HeredocDelimiterNaming
180
187
  parameters: Blacklist
181
188
  alternative: ForbiddenDelimiters
182
- - cops: Naming/PredicateName
189
+ - cops: Naming/PredicatePrefix
183
190
  parameters: NamePrefixBlacklist
184
191
  alternative: ForbiddenPrefixes
185
- - cops: Naming/PredicateName
192
+ - cops: Naming/PredicatePrefix
186
193
  parameters: NameWhitelist
187
194
  alternative: AllowedMethods
188
195
  - cops:
data/exe/rubocop CHANGED
@@ -12,13 +12,6 @@ if RuboCop::Server.running?
12
12
  exit_status = RuboCop::Server::ClientCommand::Exec.new.run
13
13
  else
14
14
  require 'rubocop'
15
-
16
- cli = RuboCop::CLI.new
17
-
18
- time_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
19
- exit_status = cli.run
20
- elapsed_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) - time_start
21
-
22
- puts "Finished in #{elapsed_time} seconds" if cli.options[:debug] || cli.options[:display_time]
15
+ exit_status = RuboCop::CLI.new.run
23
16
  end
24
17
  exit exit_status