rubocop 0.75.0 → 0.79.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/config/default.yml +341 -316
  4. data/lib/rubocop.rb +48 -31
  5. data/lib/rubocop/ast/builder.rb +43 -41
  6. data/lib/rubocop/ast/node.rb +5 -1
  7. data/lib/rubocop/ast/node/block_node.rb +2 -0
  8. data/lib/rubocop/ast/node/def_node.rb +11 -0
  9. data/lib/rubocop/ast/node/forward_args_node.rb +18 -0
  10. data/lib/rubocop/ast/node/return_node.rb +24 -0
  11. data/lib/rubocop/ast/traversal.rb +11 -3
  12. data/lib/rubocop/cli.rb +11 -227
  13. data/lib/rubocop/cli/command.rb +21 -0
  14. data/lib/rubocop/cli/command/auto_genenerate_config.rb +105 -0
  15. data/lib/rubocop/cli/command/base.rb +33 -0
  16. data/lib/rubocop/cli/command/execute_runner.rb +76 -0
  17. data/lib/rubocop/cli/command/init_dotfile.rb +45 -0
  18. data/lib/rubocop/cli/command/show_cops.rb +80 -0
  19. data/lib/rubocop/cli/command/version.rb +17 -0
  20. data/lib/rubocop/cli/environment.rb +21 -0
  21. data/lib/rubocop/comment_config.rb +2 -2
  22. data/lib/rubocop/config.rb +8 -1
  23. data/lib/rubocop/config_loader.rb +20 -20
  24. data/lib/rubocop/config_loader_resolver.rb +2 -1
  25. data/lib/rubocop/config_obsoletion.rb +73 -11
  26. data/lib/rubocop/config_validator.rb +77 -110
  27. data/lib/rubocop/cop/autocorrect_logic.rb +7 -4
  28. data/lib/rubocop/cop/bundler/gem_comment.rb +4 -4
  29. data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +2 -2
  30. data/lib/rubocop/cop/commissioner.rb +15 -7
  31. data/lib/rubocop/cop/cop.rb +31 -6
  32. data/lib/rubocop/cop/corrector.rb +8 -7
  33. data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
  34. data/lib/rubocop/cop/correctors/space_corrector.rb +1 -2
  35. data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -1
  36. data/lib/rubocop/cop/generator.rb +3 -4
  37. data/lib/rubocop/cop/generator/configuration_injector.rb +2 -2
  38. data/lib/rubocop/cop/internal_affairs.rb +1 -0
  39. data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +59 -0
  40. data/lib/rubocop/cop/layout/{align_arguments.rb → argument_alignment.rb} +1 -1
  41. data/lib/rubocop/cop/layout/{align_array.rb → array_alignment.rb} +1 -1
  42. data/lib/rubocop/cop/layout/{indent_assignment.rb → assignment_indentation.rb} +3 -2
  43. data/lib/rubocop/cop/layout/comment_indentation.rb +10 -13
  44. data/lib/rubocop/cop/layout/empty_comment.rb +7 -16
  45. data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +22 -7
  46. data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +2 -2
  47. data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +2 -2
  48. data/lib/rubocop/cop/layout/end_of_line.rb +8 -3
  49. data/lib/rubocop/cop/layout/extra_spacing.rb +1 -1
  50. data/lib/rubocop/cop/layout/{indent_first_argument.rb → first_argument_indentation.rb} +14 -12
  51. data/lib/rubocop/cop/layout/{indent_first_array_element.rb → first_array_element_indentation.rb} +4 -4
  52. data/lib/rubocop/cop/layout/{indent_first_hash_element.rb → first_hash_element_indentation.rb} +4 -4
  53. data/lib/rubocop/cop/layout/{indent_first_parameter.rb → first_parameter_indentation.rb} +3 -3
  54. data/lib/rubocop/cop/layout/{align_hash.rb → hash_alignment.rb} +16 -8
  55. data/lib/rubocop/cop/layout/{indent_heredoc.rb → heredoc_indentation.rb} +5 -5
  56. data/lib/rubocop/cop/layout/{leading_blank_lines.rb → leading_empty_lines.rb} +1 -1
  57. data/lib/rubocop/cop/{metrics → layout}/line_length.rb +41 -114
  58. data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
  59. data/lib/rubocop/cop/layout/multiline_block_layout.rb +14 -5
  60. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
  61. data/lib/rubocop/cop/layout/{align_parameters.rb → parameter_alignment.rb} +1 -1
  62. data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +2 -0
  63. data/lib/rubocop/cop/layout/space_around_keyword.rb +12 -0
  64. data/lib/rubocop/cop/layout/space_around_operators.rb +32 -7
  65. data/lib/rubocop/cop/layout/space_before_block_braces.rb +17 -0
  66. data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +9 -7
  67. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +7 -4
  68. data/lib/rubocop/cop/layout/space_inside_parens.rb +6 -6
  69. data/lib/rubocop/cop/layout/{trailing_blank_lines.rb → trailing_empty_lines.rb} +1 -1
  70. data/lib/rubocop/cop/layout/trailing_whitespace.rb +18 -2
  71. data/lib/rubocop/cop/lint/debugger.rb +2 -2
  72. data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +1 -1
  73. data/lib/rubocop/cop/lint/{duplicated_key.rb → duplicate_hash_key.rb} +1 -1
  74. data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
  75. data/lib/rubocop/cop/lint/erb_new_arguments.rb +9 -8
  76. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +1 -1
  77. data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +2 -2
  78. data/lib/rubocop/cop/lint/{multiple_compare.rb → multiple_comparison.rb} +1 -1
  79. data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +89 -0
  80. data/lib/rubocop/cop/lint/{unneeded_cop_disable_directive.rb → redundant_cop_disable_directive.rb} +26 -26
  81. data/lib/rubocop/cop/lint/{unneeded_cop_enable_directive.rb → redundant_cop_enable_directive.rb} +10 -12
  82. data/lib/rubocop/cop/lint/{unneeded_require_statement.rb → redundant_require_statement.rb} +1 -1
  83. data/lib/rubocop/cop/lint/{unneeded_splat_expansion.rb → redundant_splat_expansion.rb} +6 -6
  84. data/lib/rubocop/cop/lint/{string_conversion_in_interpolation.rb → redundant_string_coercion.rb} +1 -1
  85. data/lib/rubocop/cop/lint/redundant_with_index.rb +2 -2
  86. data/lib/rubocop/cop/lint/redundant_with_object.rb +2 -2
  87. data/lib/rubocop/cop/lint/safe_navigation_chain.rb +5 -6
  88. data/lib/rubocop/cop/lint/{handle_exceptions.rb → suppressed_exception.rb} +1 -1
  89. data/lib/rubocop/cop/lint/unused_block_argument.rb +22 -6
  90. data/lib/rubocop/cop/lint/unused_method_argument.rb +23 -5
  91. data/lib/rubocop/cop/lint/useless_access_modifier.rb +57 -23
  92. data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
  93. data/lib/rubocop/cop/lint/void.rb +7 -26
  94. data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
  95. data/lib/rubocop/cop/metrics/method_length.rb +1 -1
  96. data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +23 -6
  97. data/lib/rubocop/cop/migration/department_name.rb +16 -1
  98. data/lib/rubocop/cop/mixin/alignment.rb +1 -1
  99. data/lib/rubocop/cop/mixin/frozen_string_literal.rb +1 -7
  100. data/lib/rubocop/cop/mixin/{hash_alignment.rb → hash_alignment_styles.rb} +1 -1
  101. data/lib/rubocop/cop/mixin/line_length_help.rb +88 -0
  102. data/lib/rubocop/cop/mixin/method_complexity.rb +2 -1
  103. data/lib/rubocop/cop/mixin/nil_methods.rb +4 -4
  104. data/lib/rubocop/cop/mixin/rational_literal.rb +18 -0
  105. data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -4
  106. data/lib/rubocop/cop/mixin/trailing_comma.rb +14 -9
  107. data/lib/rubocop/cop/naming/{uncommunicative_block_param_name.rb → block_parameter_name.rb} +3 -3
  108. data/lib/rubocop/cop/naming/file_name.rb +12 -5
  109. data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +5 -5
  110. data/lib/rubocop/cop/naming/{uncommunicative_method_param_name.rb → method_parameter_name.rb} +4 -4
  111. data/lib/rubocop/cop/naming/predicate_name.rb +6 -6
  112. data/lib/rubocop/cop/offense.rb +11 -0
  113. data/lib/rubocop/cop/registry.rb +8 -3
  114. data/lib/rubocop/cop/style/alias.rb +1 -1
  115. data/lib/rubocop/cop/style/array_join.rb +1 -1
  116. data/lib/rubocop/cop/style/attr.rb +10 -2
  117. data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +6 -6
  118. data/lib/rubocop/cop/style/comment_annotation.rb +5 -5
  119. data/lib/rubocop/cop/style/conditional_assignment.rb +2 -2
  120. data/lib/rubocop/cop/style/copyright.rb +11 -7
  121. data/lib/rubocop/cop/style/documentation_method.rb +44 -0
  122. data/lib/rubocop/cop/style/double_cop_disable_directive.rb +2 -2
  123. data/lib/rubocop/cop/style/empty_case_condition.rb +2 -2
  124. data/lib/rubocop/cop/style/empty_literal.rb +2 -2
  125. data/lib/rubocop/cop/style/empty_method.rb +5 -5
  126. data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
  127. data/lib/rubocop/cop/style/even_odd.rb +1 -1
  128. data/lib/rubocop/cop/style/expand_path_arguments.rb +1 -1
  129. data/lib/rubocop/cop/style/format_string.rb +10 -7
  130. data/lib/rubocop/cop/style/format_string_token.rb +15 -34
  131. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +10 -0
  132. data/lib/rubocop/cop/style/guard_clause.rb +3 -2
  133. data/lib/rubocop/cop/style/hash_syntax.rb +2 -2
  134. data/lib/rubocop/cop/style/if_unless_modifier.rb +45 -3
  135. data/lib/rubocop/cop/style/infinite_loop.rb +5 -4
  136. data/lib/rubocop/cop/style/inverse_methods.rb +19 -13
  137. data/lib/rubocop/cop/style/ip_addresses.rb +4 -4
  138. data/lib/rubocop/cop/style/line_end_concatenation.rb +14 -10
  139. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +24 -227
  140. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +168 -0
  141. data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +54 -0
  142. data/lib/rubocop/cop/style/method_def_parentheses.rb +17 -9
  143. data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
  144. data/lib/rubocop/cop/style/multiline_method_signature.rb +1 -1
  145. data/lib/rubocop/cop/style/multiline_when_then.rb +6 -2
  146. data/lib/rubocop/cop/style/nested_modifier.rb +4 -2
  147. data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +5 -5
  148. data/lib/rubocop/cop/style/next.rb +5 -5
  149. data/lib/rubocop/cop/style/non_nil_check.rb +21 -9
  150. data/lib/rubocop/cop/style/numeric_literals.rb +7 -3
  151. data/lib/rubocop/cop/style/numeric_predicate.rb +4 -3
  152. data/lib/rubocop/cop/style/option_hash.rb +3 -3
  153. data/lib/rubocop/cop/style/percent_literal_delimiters.rb +7 -7
  154. data/lib/rubocop/cop/style/{unneeded_capital_w.rb → redundant_capital_w.rb} +1 -1
  155. data/lib/rubocop/cop/style/{unneeded_condition.rb → redundant_condition.rb} +3 -3
  156. data/lib/rubocop/cop/style/{unneeded_interpolation.rb → redundant_interpolation.rb} +1 -1
  157. data/lib/rubocop/cop/style/redundant_parentheses.rb +3 -3
  158. data/lib/rubocop/cop/style/{unneeded_percent_q.rb → redundant_percent_q.rb} +1 -1
  159. data/lib/rubocop/cop/style/redundant_return.rb +39 -29
  160. data/lib/rubocop/cop/style/{unneeded_sort.rb → redundant_sort.rb} +5 -5
  161. data/lib/rubocop/cop/style/safe_navigation.rb +19 -8
  162. data/lib/rubocop/cop/style/semicolon.rb +13 -2
  163. data/lib/rubocop/cop/style/special_global_vars.rb +5 -7
  164. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +7 -1
  165. data/lib/rubocop/cop/style/trivial_accessors.rb +5 -5
  166. data/lib/rubocop/cop/style/while_until_modifier.rb +1 -1
  167. data/lib/rubocop/cop/style/yoda_condition.rb +16 -1
  168. data/lib/rubocop/cop/team.rb +5 -0
  169. data/lib/rubocop/cop/util.rb +1 -1
  170. data/lib/rubocop/cop/utils/format_string.rb +10 -18
  171. data/lib/rubocop/cop/variable_force.rb +7 -5
  172. data/lib/rubocop/formatter/base_formatter.rb +2 -2
  173. data/lib/rubocop/formatter/clang_style_formatter.rb +9 -6
  174. data/lib/rubocop/formatter/emacs_style_formatter.rb +22 -12
  175. data/lib/rubocop/formatter/file_list_formatter.rb +1 -1
  176. data/lib/rubocop/formatter/formatter_set.rb +16 -16
  177. data/lib/rubocop/formatter/json_formatter.rb +6 -5
  178. data/lib/rubocop/formatter/pacman_formatter.rb +3 -3
  179. data/lib/rubocop/formatter/simple_text_formatter.rb +7 -3
  180. data/lib/rubocop/formatter/tap_formatter.rb +9 -6
  181. data/lib/rubocop/node_pattern.rb +4 -2
  182. data/lib/rubocop/options.rb +20 -26
  183. data/lib/rubocop/processed_source.rb +1 -1
  184. data/lib/rubocop/rake_task.rb +1 -0
  185. data/lib/rubocop/result_cache.rb +24 -8
  186. data/lib/rubocop/rspec/shared_contexts.rb +5 -0
  187. data/lib/rubocop/runner.rb +50 -29
  188. data/lib/rubocop/target_finder.rb +12 -6
  189. data/lib/rubocop/target_ruby.rb +151 -0
  190. data/lib/rubocop/version.rb +1 -1
  191. metadata +50 -34
  192. data/lib/rubocop/cop/mixin/safe_mode.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78f22d960f9c7b85730f215741a8e083b3b63396f414478d4831762e4c4cf7cb
4
- data.tar.gz: b933d30e9d959fd0ef51958f5815349cab06f8dc7069b4f10c16907e43be53a5
3
+ metadata.gz: 3bdc80758a1e3604ccf4fc91cedac86412bea6d234b27c9b7ae064fb364076ce
4
+ data.tar.gz: 2890ef6acaede12b528cf963cdbb8a90f64ecbcef6c5da6b3684fcf90c7d4c07
5
5
  SHA512:
6
- metadata.gz: 070a442e799b151ea2be23c3eb0d00ad25cc269ed6296ca3862fb6b3b25bfff238886423e7ae52cea853041038fefa354f818377cfde730b4464d7503b0680da
7
- data.tar.gz: b14a228097fd48fc7c3dd4c7674b607574f99fba7b9870b64e97b836340181b57563794dd1d5371929fa1dac7e33430eb14189447b05caba84e8ce2b5034f12e
6
+ metadata.gz: 8eb332a372b879708bedba857c21532665ad9b459b18977180fdc5d5ec0cb0f035968a907adfe70bd6e5688a97d9c321503d97d37e87cbf77b04168d1e071c1d
7
+ data.tar.gz: 98d0a07c70c4dca7c63cc96fb473a0079eee449d045b3543b55b90da3f1700c564d0f2ab7ccd909f63fefff7956680fd862710fabe2ccb0e9969b424b943216d
data/README.md CHANGED
@@ -53,7 +53,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
53
53
  might want to use a conservative version lock in your `Gemfile`:
54
54
 
55
55
  ```rb
56
- gem 'rubocop', '~> 0.75.0', require: false
56
+ gem 'rubocop', '~> 0.79.0', require: false
57
57
  ```
58
58
 
59
59
  ## Quickstart
@@ -74,7 +74,7 @@ You can read a lot more about RuboCop in its [official docs](https://docs.ruboco
74
74
  RuboCop supports the following Ruby implementations:
75
75
 
76
76
  * MRI 2.3+
77
- * JRuby 9.1+
77
+ * JRuby 9.2+
78
78
 
79
79
  ## Team
80
80
 
@@ -59,6 +59,7 @@ AllCops:
59
59
  - '**/Vagrantfile'
60
60
  Exclude:
61
61
  - 'node_modules/**/*'
62
+ - 'tmp/**/*'
62
63
  - 'vendor/**/*'
63
64
  - '.git/**/*'
64
65
  # Default formatter will be used if no `-f/--format` option is given.
@@ -141,11 +142,12 @@ Bundler/GemComment:
141
142
  Description: 'Add a comment describing each gem.'
142
143
  Enabled: false
143
144
  VersionAdded: '0.59'
145
+ VersionChanged: '0.77'
144
146
  Include:
145
147
  - '**/*.gemfile'
146
148
  - '**/Gemfile'
147
149
  - '**/gems.rb'
148
- Whitelist: []
150
+ IgnoredGems: []
149
151
 
150
152
  Bundler/InsecureProtocolSource:
151
153
  Description: >-
@@ -195,9 +197,10 @@ Gemspec/RequiredRubyVersion:
195
197
  VersionAdded: '0.52'
196
198
  Include:
197
199
  - '**/*.gemspec'
198
- -
200
+
199
201
  Gemspec/RubyVersionGlobalsUsage:
200
202
  Description: Checks usage of RUBY_VERSION in gemspec.
203
+ StyleGuide: '#no-ruby-version-in-the-gemspec'
201
204
  Enabled: true
202
205
  VersionAdded: '0.72'
203
206
  Include:
@@ -218,13 +221,14 @@ Layout/AccessModifierIndentation:
218
221
  # But it can be overridden by setting this parameter
219
222
  IndentationWidth: ~
220
223
 
221
- Layout/AlignArguments:
224
+ Layout/ArgumentAlignment:
222
225
  Description: >-
223
226
  Align the arguments of a method call if they span more
224
227
  than one line.
225
228
  StyleGuide: '#no-double-indent'
226
229
  Enabled: true
227
230
  VersionAdded: '0.68'
231
+ VersionChanged: '0.77'
228
232
  # Alignment of arguments in multi-line method calls.
229
233
  #
230
234
  # The `with_first_argument` style aligns the following lines along the same
@@ -246,117 +250,23 @@ Layout/AlignArguments:
246
250
  # But it can be overridden by setting this parameter
247
251
  IndentationWidth: ~
248
252
 
249
- Layout/AlignArray:
253
+ Layout/ArrayAlignment:
250
254
  Description: >-
251
255
  Align the elements of an array literal if they span more than
252
256
  one line.
253
257
  StyleGuide: '#align-multiline-arrays'
254
258
  Enabled: true
255
259
  VersionAdded: '0.49'
260
+ VersionChanged: '0.77'
256
261
 
257
- Layout/AlignHash:
262
+ Layout/AssignmentIndentation:
258
263
  Description: >-
259
- Align the elements of a hash literal if they span more than
260
- one line.
264
+ Checks the indentation of the first line of the
265
+ right-hand-side of a multi-line assignment.
261
266
  Enabled: true
262
- AllowMultipleStyles: true
263
267
  VersionAdded: '0.49'
264
- # Alignment of entries using hash rocket as separator. Valid values are:
265
- #
266
- # key - left alignment of keys
267
- # 'a' => 2
268
- # 'bb' => 3
269
- # separator - alignment of hash rockets, keys are right aligned
270
- # 'a' => 2
271
- # 'bb' => 3
272
- # table - left alignment of keys, hash rockets, and values
273
- # 'a' => 2
274
- # 'bb' => 3
275
- EnforcedHashRocketStyle: key
276
- SupportedHashRocketStyles:
277
- - key
278
- - separator
279
- - table
280
- # Alignment of entries using colon as separator. Valid values are:
281
- #
282
- # key - left alignment of keys
283
- # a: 0
284
- # bb: 1
285
- # separator - alignment of colons, keys are right aligned
286
- # a: 0
287
- # bb: 1
288
- # table - left alignment of keys and values
289
- # a: 0
290
- # bb: 1
291
- EnforcedColonStyle: key
292
- SupportedColonStyles:
293
- - key
294
- - separator
295
- - table
296
- # Select whether hashes that are the last argument in a method call should be
297
- # inspected? Valid values are:
298
- #
299
- # always_inspect - Inspect both implicit and explicit hashes.
300
- # Registers an offense for:
301
- # function(a: 1,
302
- # b: 2)
303
- # Registers an offense for:
304
- # function({a: 1,
305
- # b: 2})
306
- # always_ignore - Ignore both implicit and explicit hashes.
307
- # Accepts:
308
- # function(a: 1,
309
- # b: 2)
310
- # Accepts:
311
- # function({a: 1,
312
- # b: 2})
313
- # ignore_implicit - Ignore only implicit hashes.
314
- # Accepts:
315
- # function(a: 1,
316
- # b: 2)
317
- # Registers an offense for:
318
- # function({a: 1,
319
- # b: 2})
320
- # ignore_explicit - Ignore only explicit hashes.
321
- # Accepts:
322
- # function({a: 1,
323
- # b: 2})
324
- # Registers an offense for:
325
- # function(a: 1,
326
- # b: 2)
327
- EnforcedLastArgumentHashStyle: always_inspect
328
- SupportedLastArgumentHashStyles:
329
- - always_inspect
330
- - always_ignore
331
- - ignore_implicit
332
- - ignore_explicit
333
-
334
- Layout/AlignParameters:
335
- Description: >-
336
- Align the parameters of a method definition if they span more
337
- than one line.
338
- StyleGuide: '#no-double-indent'
339
- Enabled: true
340
- VersionAdded: '0.49'
341
- VersionChanged: '0.68'
342
- # Alignment of parameters in multi-line method calls.
343
- #
344
- # The `with_first_parameter` style aligns the following lines along the same
345
- # column as the first parameter.
346
- #
347
- # def method_foo(a,
348
- # b)
349
- #
350
- # The `with_fixed_indentation` style aligns the following lines with one
351
- # level of indentation relative to the start of the line with the method call.
352
- #
353
- # def method_foo(a,
354
- # b)
355
- EnforcedStyle: with_first_parameter
356
- SupportedStyles:
357
- - with_first_parameter
358
- - with_fixed_indentation
359
- # By default, the indentation width from Layout/IndentationWidth is used
268
+ VersionChanged: '0.77'
269
+ # By default, the indentation width from `Layout/IndentationWidth` is used
360
270
  # But it can be overridden by setting this parameter
361
271
  IndentationWidth: ~
362
272
 
@@ -624,56 +534,11 @@ Layout/ExtraSpacing:
624
534
  # When true, forces the alignment of `=` in assignments on consecutive lines.
625
535
  ForceEqualSignAlignment: false
626
536
 
627
- Layout/FirstArrayElementLineBreak:
628
- Description: >-
629
- Checks for a line break before the first element in a
630
- multi-line array.
631
- Enabled: false
632
- VersionAdded: '0.49'
633
-
634
- Layout/FirstHashElementLineBreak:
635
- Description: >-
636
- Checks for a line break before the first element in a
637
- multi-line hash.
638
- Enabled: false
639
- VersionAdded: '0.49'
640
-
641
- Layout/FirstMethodArgumentLineBreak:
642
- Description: >-
643
- Checks for a line break before the first argument in a
644
- multi-line method call.
645
- Enabled: false
646
- VersionAdded: '0.49'
647
-
648
- Layout/FirstMethodParameterLineBreak:
649
- Description: >-
650
- Checks for a line break before the first parameter in a
651
- multi-line method parameter definition.
652
- Enabled: false
653
- VersionAdded: '0.49'
654
-
655
- Layout/HeredocArgumentClosingParenthesis:
656
- Description: >-
657
- Checks for the placement of the closing parenthesis in a
658
- method call that passes a HEREDOC string as an argument.
659
- Enabled: false
660
- StyleGuide: '#heredoc-argument-closing-parentheses'
661
- VersionAdded: '0.68'
662
-
663
- Layout/IndentAssignment:
664
- Description: >-
665
- Checks the indentation of the first line of the
666
- right-hand-side of a multi-line assignment.
667
- Enabled: true
668
- VersionAdded: '0.49'
669
- # By default, the indentation width from `Layout/IndentationWidth` is used
670
- # But it can be overridden by setting this parameter
671
- IndentationWidth: ~
672
-
673
- Layout/IndentFirstArgument:
537
+ Layout/FirstArgumentIndentation:
674
538
  Description: 'Checks the indentation of the first argument in a method call.'
675
539
  Enabled: true
676
540
  VersionAdded: '0.68'
541
+ VersionChanged: '0.77'
677
542
  EnforcedStyle: special_for_inner_method_call_in_parentheses
678
543
  SupportedStyles:
679
544
  # The first parameter should always be indented one step more than the
@@ -694,12 +559,13 @@ Layout/IndentFirstArgument:
694
559
  # But it can be overridden by setting this parameter
695
560
  IndentationWidth: ~
696
561
 
697
- Layout/IndentFirstArrayElement:
562
+ Layout/FirstArrayElementIndentation:
698
563
  Description: >-
699
564
  Checks the indentation of the first element in an array
700
565
  literal.
701
566
  Enabled: true
702
567
  VersionAdded: '0.68'
568
+ VersionChanged: '0.77'
703
569
  # The value `special_inside_parentheses` means that array literals with
704
570
  # brackets that have their opening bracket on the same line as a surrounding
705
571
  # opening round parenthesis, shall have their first element indented relative
@@ -720,10 +586,18 @@ Layout/IndentFirstArrayElement:
720
586
  # But it can be overridden by setting this parameter
721
587
  IndentationWidth: ~
722
588
 
723
- Layout/IndentFirstHashElement:
589
+ Layout/FirstArrayElementLineBreak:
590
+ Description: >-
591
+ Checks for a line break before the first element in a
592
+ multi-line array.
593
+ Enabled: false
594
+ VersionAdded: '0.49'
595
+
596
+ Layout/FirstHashElementIndentation:
724
597
  Description: 'Checks the indentation of the first key in a hash literal.'
725
598
  Enabled: true
726
599
  VersionAdded: '0.68'
600
+ VersionChanged: '0.77'
727
601
  # The value `special_inside_parentheses` means that hash literals with braces
728
602
  # that have their opening brace on the same line as a surrounding opening
729
603
  # round parenthesis, shall have their first key indented relative to the
@@ -744,13 +618,34 @@ Layout/IndentFirstHashElement:
744
618
  # But it can be overridden by setting this parameter
745
619
  IndentationWidth: ~
746
620
 
747
- Layout/IndentFirstParameter:
621
+ Layout/FirstHashElementLineBreak:
622
+ Description: >-
623
+ Checks for a line break before the first element in a
624
+ multi-line hash.
625
+ Enabled: false
626
+ VersionAdded: '0.49'
627
+
628
+ Layout/FirstMethodArgumentLineBreak:
629
+ Description: >-
630
+ Checks for a line break before the first argument in a
631
+ multi-line method call.
632
+ Enabled: false
633
+ VersionAdded: '0.49'
634
+
635
+ Layout/FirstMethodParameterLineBreak:
636
+ Description: >-
637
+ Checks for a line break before the first parameter in a
638
+ multi-line method parameter definition.
639
+ Enabled: false
640
+ VersionAdded: '0.49'
641
+
642
+ Layout/FirstParameterIndentation:
748
643
  Description: >-
749
644
  Checks the indentation of the first parameter in a
750
645
  method definition.
751
646
  Enabled: true
752
647
  VersionAdded: '0.49'
753
- VersionChanged: '0.68'
648
+ VersionChanged: '0.77'
754
649
  EnforcedStyle: consistent
755
650
  SupportedStyles:
756
651
  - consistent
@@ -759,12 +654,98 @@ Layout/IndentFirstParameter:
759
654
  # But it can be overridden by setting this parameter
760
655
  IndentationWidth: ~
761
656
 
762
- Layout/IndentHeredoc:
657
+ Layout/HashAlignment:
658
+ Description: >-
659
+ Align the elements of a hash literal if they span more than
660
+ one line.
661
+ Enabled: true
662
+ AllowMultipleStyles: true
663
+ VersionAdded: '0.49'
664
+ VersionChanged: '0.77'
665
+ # Alignment of entries using hash rocket as separator. Valid values are:
666
+ #
667
+ # key - left alignment of keys
668
+ # 'a' => 2
669
+ # 'bb' => 3
670
+ # separator - alignment of hash rockets, keys are right aligned
671
+ # 'a' => 2
672
+ # 'bb' => 3
673
+ # table - left alignment of keys, hash rockets, and values
674
+ # 'a' => 2
675
+ # 'bb' => 3
676
+ EnforcedHashRocketStyle: key
677
+ SupportedHashRocketStyles:
678
+ - key
679
+ - separator
680
+ - table
681
+ # Alignment of entries using colon as separator. Valid values are:
682
+ #
683
+ # key - left alignment of keys
684
+ # a: 0
685
+ # bb: 1
686
+ # separator - alignment of colons, keys are right aligned
687
+ # a: 0
688
+ # bb: 1
689
+ # table - left alignment of keys and values
690
+ # a: 0
691
+ # bb: 1
692
+ EnforcedColonStyle: key
693
+ SupportedColonStyles:
694
+ - key
695
+ - separator
696
+ - table
697
+ # Select whether hashes that are the last argument in a method call should be
698
+ # inspected? Valid values are:
699
+ #
700
+ # always_inspect - Inspect both implicit and explicit hashes.
701
+ # Registers an offense for:
702
+ # function(a: 1,
703
+ # b: 2)
704
+ # Registers an offense for:
705
+ # function({a: 1,
706
+ # b: 2})
707
+ # always_ignore - Ignore both implicit and explicit hashes.
708
+ # Accepts:
709
+ # function(a: 1,
710
+ # b: 2)
711
+ # Accepts:
712
+ # function({a: 1,
713
+ # b: 2})
714
+ # ignore_implicit - Ignore only implicit hashes.
715
+ # Accepts:
716
+ # function(a: 1,
717
+ # b: 2)
718
+ # Registers an offense for:
719
+ # function({a: 1,
720
+ # b: 2})
721
+ # ignore_explicit - Ignore only explicit hashes.
722
+ # Accepts:
723
+ # function({a: 1,
724
+ # b: 2})
725
+ # Registers an offense for:
726
+ # function(a: 1,
727
+ # b: 2)
728
+ EnforcedLastArgumentHashStyle: always_inspect
729
+ SupportedLastArgumentHashStyles:
730
+ - always_inspect
731
+ - always_ignore
732
+ - ignore_implicit
733
+ - ignore_explicit
734
+
735
+ Layout/HeredocArgumentClosingParenthesis:
736
+ Description: >-
737
+ Checks for the placement of the closing parenthesis in a
738
+ method call that passes a HEREDOC string as an argument.
739
+ Enabled: false
740
+ StyleGuide: '#heredoc-argument-closing-parentheses'
741
+ VersionAdded: '0.68'
742
+
743
+ Layout/HeredocIndentation:
763
744
  Description: 'This cop checks the indentation of the here document bodies.'
764
745
  StyleGuide: '#squiggly-heredocs'
765
746
  Enabled: true
766
747
  VersionAdded: '0.49'
767
- VersionChanged: '0.69'
748
+ VersionChanged: '0.77'
768
749
  EnforcedStyle: squiggly
769
750
  SupportedStyles:
770
751
  - squiggly
@@ -806,11 +787,6 @@ Layout/InitialIndentation:
806
787
  Enabled: true
807
788
  VersionAdded: '0.49'
808
789
 
809
- Layout/LeadingBlankLines:
810
- Description: Check for unnecessary blank lines at the beginning of a file.
811
- Enabled: true
812
- VersionAdded: '0.57'
813
-
814
790
  Layout/LeadingCommentSpace:
815
791
  Description: 'Comments should start with a space.'
816
792
  StyleGuide: '#hash-space'
@@ -819,6 +795,35 @@ Layout/LeadingCommentSpace:
819
795
  VersionChanged: '0.73'
820
796
  AllowDoxygenCommentStyle: false
821
797
 
798
+ Layout/LeadingEmptyLines:
799
+ Description: Check for unnecessary blank lines at the beginning of a file.
800
+ Enabled: true
801
+ VersionAdded: '0.57'
802
+ VersionChanged: '0.77'
803
+
804
+ Layout/LineLength:
805
+ Description: 'Limit lines to 80 characters.'
806
+ StyleGuide: '#80-character-limits'
807
+ Enabled: true
808
+ VersionAdded: '0.25'
809
+ VersionChanged: '0.78'
810
+ AutoCorrect: false
811
+ Max: 80
812
+ # To make it possible to copy or click on URIs in the code, we allow lines
813
+ # containing a URI to be longer than Max.
814
+ AllowHeredoc: true
815
+ AllowURI: true
816
+ URISchemes:
817
+ - http
818
+ - https
819
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
820
+ # directives like '# rubocop: enable ...' when calculating a line's length.
821
+ IgnoreCopDirectives: true
822
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
823
+ # elements. Strings will be converted to Regexp objects. A line that matches
824
+ # any regular expression listed in this option will be ignored by LineLength.
825
+ IgnoredPatterns: []
826
+
822
827
  Layout/MultilineArrayBraceLayout:
823
828
  Description: >-
824
829
  Checks that the closing brace in an array literal is
@@ -960,6 +965,35 @@ Layout/MultilineOperationIndentation:
960
965
  # But it can be overridden by setting this parameter
961
966
  IndentationWidth: ~
962
967
 
968
+ Layout/ParameterAlignment:
969
+ Description: >-
970
+ Align the parameters of a method definition if they span more
971
+ than one line.
972
+ StyleGuide: '#no-double-indent'
973
+ Enabled: true
974
+ VersionAdded: '0.49'
975
+ VersionChanged: '0.77'
976
+ # Alignment of parameters in multi-line method calls.
977
+ #
978
+ # The `with_first_parameter` style aligns the following lines along the same
979
+ # column as the first parameter.
980
+ #
981
+ # def method_foo(a,
982
+ # b)
983
+ #
984
+ # The `with_fixed_indentation` style aligns the following lines with one
985
+ # level of indentation relative to the start of the line with the method call.
986
+ #
987
+ # def method_foo(a,
988
+ # b)
989
+ EnforcedStyle: with_first_parameter
990
+ SupportedStyles:
991
+ - with_first_parameter
992
+ - with_fixed_indentation
993
+ # By default, the indentation width from Layout/IndentationWidth is used
994
+ # But it can be overridden by setting this parameter
995
+ IndentationWidth: ~
996
+
963
997
  Layout/RescueEnsureAlignment:
964
998
  Description: 'Align rescues and ensures correctly.'
965
999
  Enabled: true
@@ -1033,6 +1067,10 @@ Layout/SpaceAroundOperators:
1033
1067
  # with an operator on the previous or next line, not counting empty lines
1034
1068
  # or comment lines.
1035
1069
  AllowForAlignment: true
1070
+ EnforcedStyleForExponentOperator: no_space
1071
+ SupportedStylesForExponentOperator:
1072
+ - space
1073
+ - no_space
1036
1074
 
1037
1075
  Layout/SpaceBeforeBlockBraces:
1038
1076
  Description: >-
@@ -1202,11 +1240,12 @@ Layout/Tab:
1202
1240
  # replace each tab.
1203
1241
  IndentationWidth: ~
1204
1242
 
1205
- Layout/TrailingBlankLines:
1243
+ Layout/TrailingEmptyLines:
1206
1244
  Description: 'Checks trailing blank lines and final newline.'
1207
1245
  StyleGuide: '#newline-eof'
1208
1246
  Enabled: true
1209
1247
  VersionAdded: '0.49'
1248
+ VersionChanged: '0.77'
1210
1249
  EnforcedStyle: final_newline
1211
1250
  SupportedStyles:
1212
1251
  - final_newline
@@ -1290,16 +1329,17 @@ Lint/DuplicateCaseCondition:
1290
1329
  Enabled: true
1291
1330
  VersionAdded: '0.45'
1292
1331
 
1332
+ Lint/DuplicateHashKey:
1333
+ Description: 'Check for duplicate keys in hash literals.'
1334
+ Enabled: true
1335
+ VersionAdded: '0.34'
1336
+ VersionChanged: '0.77'
1337
+
1293
1338
  Lint/DuplicateMethods:
1294
1339
  Description: 'Check for duplicate method definitions.'
1295
1340
  Enabled: true
1296
1341
  VersionAdded: '0.29'
1297
1342
 
1298
- Lint/DuplicatedKey:
1299
- Description: 'Check for duplicate keys in hash literals.'
1300
- Enabled: true
1301
- VersionAdded: '0.34'
1302
-
1303
1343
  Lint/EachWithObjectArgument:
1304
1344
  Description: 'Check for immutable argument given to each_with_object.'
1305
1345
  Enabled: true
@@ -1367,14 +1407,6 @@ Lint/FormatParameterMismatch:
1367
1407
  Enabled: true
1368
1408
  VersionAdded: '0.33'
1369
1409
 
1370
- Lint/HandleExceptions:
1371
- Description: "Don't suppress exception."
1372
- StyleGuide: '#dont-hide-exceptions'
1373
- Enabled: true
1374
- AllowComments: false
1375
- VersionAdded: '0.9'
1376
- VersionChanged: '0.70'
1377
-
1378
1410
  Lint/HeredocMethodCallPosition:
1379
1411
  Description: >-
1380
1412
  Checks for the ordering of a method call where
@@ -1444,10 +1476,11 @@ Lint/MissingCopEnableDirective:
1444
1476
  # .inf for any size
1445
1477
  MaximumRangeSize: .inf
1446
1478
 
1447
- Lint/MultipleCompare:
1448
- Description: "Use `&&` operator to compare multiple value."
1479
+ Lint/MultipleComparison:
1480
+ Description: "Use `&&` operator to compare multiple values."
1449
1481
  Enabled: true
1450
1482
  VersionAdded: '0.47'
1483
+ VersionChanged: '0.77'
1451
1484
 
1452
1485
  Lint/NestedMethodDefinition:
1453
1486
  Description: 'Do not use nested method definitions.'
@@ -1467,6 +1500,12 @@ Lint/NextWithoutAccumulator:
1467
1500
  Enabled: true
1468
1501
  VersionAdded: '0.36'
1469
1502
 
1503
+ Lint/NonDeterministicRequireOrder:
1504
+ Description: 'Always sort arrays returned by Dir.glob when requiring files.'
1505
+ Enabled: true
1506
+ VersionAdded: '0.78'
1507
+ Safe: false
1508
+
1470
1509
  Lint/NonLocalExitFromIterator:
1471
1510
  Description: 'Do not use return in iterator to cause non-local exit.'
1472
1511
  Enabled: true
@@ -1512,6 +1551,36 @@ Lint/RandOne:
1512
1551
  Enabled: true
1513
1552
  VersionAdded: '0.36'
1514
1553
 
1554
+ Lint/RedundantCopDisableDirective:
1555
+ Description: >-
1556
+ Checks for rubocop:disable comments that can be removed.
1557
+ Note: this cop is not disabled when disabling all cops.
1558
+ It must be explicitly disabled.
1559
+ Enabled: true
1560
+ VersionAdded: '0.76'
1561
+
1562
+ Lint/RedundantCopEnableDirective:
1563
+ Description: Checks for rubocop:enable comments that can be removed.
1564
+ Enabled: true
1565
+ VersionAdded: '0.76'
1566
+
1567
+ Lint/RedundantRequireStatement:
1568
+ Description: 'Checks for unnecessary `require` statement.'
1569
+ Enabled: true
1570
+ VersionAdded: '0.76'
1571
+
1572
+ Lint/RedundantSplatExpansion:
1573
+ Description: 'Checks for splat unnecessarily being called on literals.'
1574
+ Enabled: true
1575
+ VersionChanged: '0.76'
1576
+
1577
+ Lint/RedundantStringCoercion:
1578
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1579
+ StyleGuide: '#no-to-s'
1580
+ Enabled: true
1581
+ VersionAdded: '0.19'
1582
+ VersionChanged: '0.77'
1583
+
1515
1584
  Lint/RedundantWithIndex:
1516
1585
  Description: 'Checks for redundant `with_index`.'
1517
1586
  Enabled: true
@@ -1557,8 +1626,8 @@ Lint/SafeNavigationChain:
1557
1626
  Description: 'Do not chain ordinary method call after safe navigation operator.'
1558
1627
  Enabled: true
1559
1628
  VersionAdded: '0.47'
1560
- VersionChanged: '0.56'
1561
- Whitelist:
1629
+ VersionChanged: '0.77'
1630
+ AllowedMethods:
1562
1631
  - present?
1563
1632
  - blank?
1564
1633
  - presence
@@ -1572,14 +1641,14 @@ Lint/SafeNavigationConsistency:
1572
1641
  for all method calls on that same object.
1573
1642
  Enabled: true
1574
1643
  VersionAdded: '0.55'
1575
- Whitelist:
1644
+ VersionChanged: '0.77'
1645
+ AllowedMethods:
1576
1646
  - present?
1577
1647
  - blank?
1578
1648
  - presence
1579
1649
  - try
1580
1650
  - try!
1581
1651
 
1582
-
1583
1652
  Lint/SafeNavigationWithEmpty:
1584
1653
  Description: 'Avoid `foo&.empty?` in conditionals.'
1585
1654
  Enabled: true
@@ -1617,12 +1686,13 @@ Lint/ShadowingOuterLocalVariable:
1617
1686
  Enabled: true
1618
1687
  VersionAdded: '0.9'
1619
1688
 
1620
- Lint/StringConversionInInterpolation:
1621
- Description: 'Checks for Object#to_s usage in string interpolation.'
1622
- StyleGuide: '#no-to-s'
1689
+ Lint/SuppressedException:
1690
+ Description: "Don't suppress exceptions."
1691
+ StyleGuide: '#dont-hide-exceptions'
1623
1692
  Enabled: true
1624
- VersionAdded: '0.19'
1625
- VersionChanged: '0.20'
1693
+ AllowComments: false
1694
+ VersionAdded: '0.9'
1695
+ VersionChanged: '0.77'
1626
1696
 
1627
1697
  Lint/Syntax:
1628
1698
  Description: 'Checks syntax error.'
@@ -1645,30 +1715,6 @@ Lint/UnifiedInteger:
1645
1715
  Enabled: true
1646
1716
  VersionAdded: '0.43'
1647
1717
 
1648
- Lint/UnneededCopDisableDirective:
1649
- Description: >-
1650
- Checks for rubocop:disable comments that can be removed.
1651
- Note: this cop is not disabled when disabling all cops.
1652
- It must be explicitly disabled.
1653
- Enabled: true
1654
- VersionAdded: '0.53'
1655
-
1656
- Lint/UnneededCopEnableDirective:
1657
- Description: Checks for rubocop:enable comments that can be removed.
1658
- Enabled: true
1659
- VersionAdded: '0.53'
1660
-
1661
- Lint/UnneededRequireStatement:
1662
- Description: 'Checks for unnecessary `require` statement.'
1663
- Enabled: true
1664
- VersionAdded: '0.51'
1665
-
1666
- Lint/UnneededSplatExpansion:
1667
- Description: 'Checks for splat unnecessarily being called on literals.'
1668
- Enabled: true
1669
- VersionAdded: '0.43'
1670
- VersionChanged: '0.74'
1671
-
1672
1718
  Lint/UnreachableCode:
1673
1719
  Description: 'Unreachable code.'
1674
1720
  Enabled: true
@@ -1798,29 +1844,6 @@ Metrics/CyclomaticComplexity:
1798
1844
  VersionAdded: '0.25'
1799
1845
  Max: 6
1800
1846
 
1801
- Metrics/LineLength:
1802
- Description: 'Limit lines to 80 characters.'
1803
- StyleGuide: '#80-character-limits'
1804
- Enabled: true
1805
- VersionAdded: '0.25'
1806
- VersionChanged: '0.68'
1807
- AutoCorrect: false
1808
- Max: 80
1809
- # To make it possible to copy or click on URIs in the code, we allow lines
1810
- # containing a URI to be longer than Max.
1811
- AllowHeredoc: true
1812
- AllowURI: true
1813
- URISchemes:
1814
- - http
1815
- - https
1816
- # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1817
- # directives like '# rubocop: enable ...' when calculating a line's length.
1818
- IgnoreCopDirectives: false
1819
- # The IgnoredPatterns option is a list of !ruby/regexp and/or string
1820
- # elements. Strings will be converted to Regexp objects. A line that matches
1821
- # any regular expression listed in this option will be ignored by LineLength.
1822
- IgnoredPatterns: []
1823
-
1824
1847
  Metrics/MethodLength:
1825
1848
  Description: 'Avoid methods longer than 10 lines of code.'
1826
1849
  StyleGuide: '#short-methods'
@@ -1882,6 +1905,21 @@ Naming/BinaryOperatorParameterName:
1882
1905
  Enabled: true
1883
1906
  VersionAdded: '0.50'
1884
1907
 
1908
+ Naming/BlockParameterName:
1909
+ Description: >-
1910
+ Checks for block parameter names that contain capital letters,
1911
+ end in numbers, or do not meet a minimal length.
1912
+ Enabled: true
1913
+ VersionAdded: '0.53'
1914
+ VersionChanged: '0.77'
1915
+ # Parameter names may be equal to or greater than this value
1916
+ MinNameLength: 1
1917
+ AllowNamesEndingInNumbers: true
1918
+ # Allowed names that will not register an offense
1919
+ AllowedNames: []
1920
+ # Forbidden names that will register an offense
1921
+ ForbiddenNames: []
1922
+
1885
1923
  Naming/ClassAndModuleCamelCase:
1886
1924
  Description: 'Use CamelCase for classes and modules.'
1887
1925
  StyleGuide: '#camelcase-classes'
@@ -1973,7 +2011,7 @@ Naming/HeredocDelimiterNaming:
1973
2011
  StyleGuide: '#heredoc-delimiters'
1974
2012
  Enabled: true
1975
2013
  VersionAdded: '0.50'
1976
- Blacklist:
2014
+ ForbiddenDelimiters:
1977
2015
  - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
1978
2016
 
1979
2017
  Naming/MemoizedInstanceVariableName:
@@ -2005,25 +2043,50 @@ Naming/MethodName:
2005
2043
  #
2006
2044
  IgnoredPatterns: []
2007
2045
 
2046
+ Naming/MethodParameterName:
2047
+ Description: >-
2048
+ Checks for method parameter names that contain capital letters,
2049
+ end in numbers, or do not meet a minimal length.
2050
+ Enabled: true
2051
+ VersionAdded: '0.53'
2052
+ VersionChanged: '0.77'
2053
+ # Parameter names may be equal to or greater than this value
2054
+ MinNameLength: 3
2055
+ AllowNamesEndingInNumbers: true
2056
+ # Allowed names that will not register an offense
2057
+ AllowedNames:
2058
+ - io
2059
+ - id
2060
+ - to
2061
+ - by
2062
+ - 'on'
2063
+ - in
2064
+ - at
2065
+ - ip
2066
+ - db
2067
+ - os
2068
+ # Forbidden names that will register an offense
2069
+ ForbiddenNames: []
2070
+
2008
2071
  Naming/PredicateName:
2009
2072
  Description: 'Check the names of predicate methods.'
2010
2073
  StyleGuide: '#bool-methods-qmark'
2011
2074
  Enabled: true
2012
2075
  VersionAdded: '0.50'
2013
- VersionChanged: '0.51'
2076
+ VersionChanged: '0.77'
2014
2077
  # Predicate name prefixes.
2015
2078
  NamePrefix:
2016
2079
  - is_
2017
2080
  - has_
2018
2081
  - have_
2019
2082
  # Predicate name prefixes that should be removed.
2020
- NamePrefixBlacklist:
2083
+ ForbiddenPrefixes:
2021
2084
  - is_
2022
2085
  - has_
2023
2086
  - have_
2024
- # Predicate names which, despite having a blacklisted prefix, or no `?`,
2087
+ # Predicate names which, despite having a forbidden prefix, or no `?`,
2025
2088
  # should still be accepted
2026
- NameWhitelist:
2089
+ AllowedMethods:
2027
2090
  - is_a?
2028
2091
  # Method definition macros for dynamically generated methods.
2029
2092
  MethodDefinitionMacros:
@@ -2041,45 +2104,6 @@ Naming/RescuedExceptionsVariableName:
2041
2104
  VersionChanged: '0.68'
2042
2105
  PreferredName: e
2043
2106
 
2044
- Naming/UncommunicativeBlockParamName:
2045
- Description: >-
2046
- Checks for block parameter names that contain capital letters,
2047
- end in numbers, or do not meet a minimal length.
2048
- Enabled: true
2049
- VersionAdded: '0.53'
2050
- # Parameter names may be equal to or greater than this value
2051
- MinNameLength: 1
2052
- AllowNamesEndingInNumbers: true
2053
- # Whitelisted names that will not register an offense
2054
- AllowedNames: []
2055
- # Blacklisted names that will register an offense
2056
- ForbiddenNames: []
2057
-
2058
- Naming/UncommunicativeMethodParamName:
2059
- Description: >-
2060
- Checks for method parameter names that contain capital letters,
2061
- end in numbers, or do not meet a minimal length.
2062
- Enabled: true
2063
- VersionAdded: '0.53'
2064
- VersionChanged: '0.59'
2065
- # Parameter names may be equal to or greater than this value
2066
- MinNameLength: 3
2067
- AllowNamesEndingInNumbers: true
2068
- # Whitelisted names that will not register an offense
2069
- AllowedNames:
2070
- - io
2071
- - id
2072
- - to
2073
- - by
2074
- - 'on'
2075
- - in
2076
- - at
2077
- - ip
2078
- - db
2079
- # Blacklisted names that will register an offense
2080
- ForbiddenNames: []
2081
-
2082
-
2083
2107
  Naming/VariableName:
2084
2108
  Description: 'Use the configured style when naming variables.'
2085
2109
  StyleGuide: '#snake-case-symbols-methods-vars'
@@ -2734,7 +2758,7 @@ Style/FrozenStringLiteralComment:
2734
2758
  to help transition to frozen string literals by default.
2735
2759
  Enabled: true
2736
2760
  VersionAdded: '0.36'
2737
- VersionChanged: '0.69'
2761
+ VersionChanged: '0.79'
2738
2762
  EnforcedStyle: always
2739
2763
  SupportedStyles:
2740
2764
  # `always` will always add the frozen string literal comment to a file
@@ -2745,6 +2769,7 @@ Style/FrozenStringLiteralComment:
2745
2769
  # `never` will enforce that the frozen string literal comment does not
2746
2770
  # exist in a file.
2747
2771
  - never
2772
+ Safe: false
2748
2773
 
2749
2774
  Style/GlobalVars:
2750
2775
  Description: 'Do not introduce global variables.'
@@ -2874,8 +2899,9 @@ Style/IpAddresses:
2874
2899
  Description: "Don't include literal IP addresses in code."
2875
2900
  Enabled: false
2876
2901
  VersionAdded: '0.58'
2877
- # Allow strings to be whitelisted
2878
- Whitelist:
2902
+ VersionChanged: '0.77'
2903
+ # Allow addresses to be permitted
2904
+ AllowedAddresses:
2879
2905
  - "::"
2880
2906
  # :: is a valid IPv6 address, but could potentially be legitimately in code
2881
2907
 
@@ -3148,8 +3174,8 @@ Style/NestedParenthesizedCalls:
3148
3174
  argument list of another parenthesized method call.
3149
3175
  Enabled: true
3150
3176
  VersionAdded: '0.36'
3151
- VersionChanged: '0.50'
3152
- Whitelist:
3177
+ VersionChanged: '0.77'
3178
+ AllowedMethods:
3153
3179
  - be
3154
3180
  - be_a
3155
3181
  - be_an
@@ -3402,6 +3428,16 @@ Style/RedundantBegin:
3402
3428
  VersionAdded: '0.10'
3403
3429
  VersionChanged: '0.21'
3404
3430
 
3431
+ Style/RedundantCapitalW:
3432
+ Description: 'Checks for %W when interpolation is not needed.'
3433
+ Enabled: true
3434
+ VersionAdded: '0.76'
3435
+
3436
+ Style/RedundantCondition:
3437
+ Description: 'Checks for unnecessary conditional expressions.'
3438
+ Enabled: true
3439
+ VersionAdded: '0.76'
3440
+
3405
3441
  Style/RedundantConditional:
3406
3442
  Description: "Don't return true/false from a conditional."
3407
3443
  Enabled: true
@@ -3420,11 +3456,22 @@ Style/RedundantFreeze:
3420
3456
  VersionAdded: '0.34'
3421
3457
  VersionChanged: '0.66'
3422
3458
 
3459
+ Style/RedundantInterpolation:
3460
+ Description: 'Checks for strings that are just an interpolated expression.'
3461
+ Enabled: true
3462
+ VersionAdded: '0.76'
3463
+
3423
3464
  Style/RedundantParentheses:
3424
3465
  Description: "Checks for parentheses that seem not to serve any purpose."
3425
3466
  Enabled: true
3426
3467
  VersionAdded: '0.36'
3427
3468
 
3469
+ Style/RedundantPercentQ:
3470
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
3471
+ StyleGuide: '#percent-q'
3472
+ Enabled: true
3473
+ VersionAdded: '0.76'
3474
+
3428
3475
  Style/RedundantReturn:
3429
3476
  Description: "Don't use return where it's not required."
3430
3477
  StyleGuide: '#no-explicit-return'
@@ -3441,6 +3488,13 @@ Style/RedundantSelf:
3441
3488
  VersionAdded: '0.10'
3442
3489
  VersionChanged: '0.13'
3443
3490
 
3491
+ Style/RedundantSort:
3492
+ Description: >-
3493
+ Use `min` instead of `sort.first`,
3494
+ `max_by` instead of `sort_by...last`, etc.
3495
+ Enabled: true
3496
+ VersionAdded: '0.76'
3497
+
3444
3498
  Style/RedundantSortBy:
3445
3499
  Description: 'Use `sort` instead of `sort_by { |x| x }`.'
3446
3500
  Enabled: true
@@ -3498,11 +3552,11 @@ Style/SafeNavigation:
3498
3552
  safe navigation (`&.`).
3499
3553
  Enabled: true
3500
3554
  VersionAdded: '0.43'
3501
- VersionChanged: '0.56'
3555
+ VersionChanged: '0.77'
3502
3556
  # Safe navigation may cause a statement to start returning `nil` in addition
3503
3557
  # to whatever it used to return.
3504
3558
  ConvertCodeThatCanStartToReturnNil: false
3505
- Whitelist:
3559
+ AllowedMethods:
3506
3560
  - present?
3507
3561
  - blank?
3508
3562
  - presence
@@ -3780,7 +3834,7 @@ Style/TrivialAccessors:
3780
3834
  StyleGuide: '#attr_family'
3781
3835
  Enabled: true
3782
3836
  VersionAdded: '0.9'
3783
- VersionChanged: '0.38'
3837
+ VersionChanged: '0.77'
3784
3838
  # When set to `false` the cop will suggest the use of accessor methods
3785
3839
  # in situations like:
3786
3840
  #
@@ -3801,7 +3855,7 @@ Style/TrivialAccessors:
3801
3855
  # Commonly used in DSLs
3802
3856
  AllowDSLWriters: false
3803
3857
  IgnoreClassMethods: false
3804
- Whitelist:
3858
+ AllowedMethods:
3805
3859
  - to_ary
3806
3860
  - to_a
3807
3861
  - to_c
@@ -3828,35 +3882,6 @@ Style/UnlessElse:
3828
3882
  Enabled: true
3829
3883
  VersionAdded: '0.9'
3830
3884
 
3831
- Style/UnneededCapitalW:
3832
- Description: 'Checks for %W when interpolation is not needed.'
3833
- Enabled: true
3834
- VersionAdded: '0.21'
3835
- VersionChanged: '0.24'
3836
-
3837
- Style/UnneededCondition:
3838
- Description: 'Checks for unnecessary conditional expressions.'
3839
- Enabled: true
3840
- VersionAdded: '0.57'
3841
-
3842
- Style/UnneededInterpolation:
3843
- Description: 'Checks for strings that are just an interpolated expression.'
3844
- Enabled: true
3845
- VersionAdded: '0.36'
3846
-
3847
- Style/UnneededPercentQ:
3848
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
3849
- StyleGuide: '#percent-q'
3850
- Enabled: true
3851
- VersionAdded: '0.24'
3852
-
3853
- Style/UnneededSort:
3854
- Description: >-
3855
- Use `min` instead of `sort.first`,
3856
- `max_by` instead of `sort_by...last`, etc.
3857
- Enabled: true
3858
- VersionAdded: '0.55'
3859
-
3860
3885
  Style/UnpackFirst:
3861
3886
  Description: >-
3862
3887
  Checks for accessing the first element of `String#unpack`