rubocop 0.73.0 → 0.77.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/bin/console +1 -0
  4. data/config/default.yml +332 -295
  5. data/lib/rubocop.rb +46 -30
  6. data/lib/rubocop/ast/builder.rb +1 -0
  7. data/lib/rubocop/ast/node.rb +6 -8
  8. data/lib/rubocop/ast/node/block_node.rb +2 -0
  9. data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +1 -12
  10. data/lib/rubocop/ast/node/return_node.rb +24 -0
  11. data/lib/rubocop/cli.rb +11 -227
  12. data/lib/rubocop/cli/command.rb +21 -0
  13. data/lib/rubocop/cli/command/auto_genenerate_config.rb +105 -0
  14. data/lib/rubocop/cli/command/base.rb +33 -0
  15. data/lib/rubocop/cli/command/execute_runner.rb +76 -0
  16. data/lib/rubocop/cli/command/init_dotfile.rb +45 -0
  17. data/lib/rubocop/cli/command/show_cops.rb +73 -0
  18. data/lib/rubocop/cli/command/version.rb +17 -0
  19. data/lib/rubocop/cli/environment.rb +21 -0
  20. data/lib/rubocop/comment_config.rb +5 -4
  21. data/lib/rubocop/config.rb +28 -537
  22. data/lib/rubocop/config_loader.rb +21 -3
  23. data/lib/rubocop/config_loader_resolver.rb +4 -3
  24. data/lib/rubocop/config_obsoletion.rb +275 -0
  25. data/lib/rubocop/config_validator.rb +246 -0
  26. data/lib/rubocop/cop/autocorrect_logic.rb +2 -2
  27. data/lib/rubocop/cop/bundler/gem_comment.rb +4 -4
  28. data/lib/rubocop/cop/commissioner.rb +15 -7
  29. data/lib/rubocop/cop/cop.rb +33 -9
  30. data/lib/rubocop/cop/corrector.rb +8 -7
  31. data/lib/rubocop/cop/correctors/alignment_corrector.rb +43 -17
  32. data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +2 -2
  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/generator.rb +3 -3
  36. data/lib/rubocop/cop/generator/configuration_injector.rb +9 -4
  37. data/lib/rubocop/cop/generator/require_file_injector.rb +1 -1
  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} +11 -2
  43. data/lib/rubocop/cop/layout/block_alignment.rb +2 -2
  44. data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +1 -1
  45. data/lib/rubocop/cop/layout/comment_indentation.rb +10 -13
  46. data/lib/rubocop/cop/layout/empty_comment.rb +7 -16
  47. data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +22 -7
  48. data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +2 -2
  49. data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +2 -2
  50. data/lib/rubocop/cop/layout/end_of_line.rb +8 -3
  51. data/lib/rubocop/cop/layout/extra_spacing.rb +15 -60
  52. data/lib/rubocop/cop/layout/{indent_first_argument.rb → first_argument_indentation.rb} +12 -10
  53. data/lib/rubocop/cop/layout/{indent_first_array_element.rb → first_array_element_indentation.rb} +4 -4
  54. data/lib/rubocop/cop/layout/{indent_first_hash_element.rb → first_hash_element_indentation.rb} +4 -4
  55. data/lib/rubocop/cop/layout/{indent_first_parameter.rb → first_parameter_indentation.rb} +3 -3
  56. data/lib/rubocop/cop/layout/{align_hash.rb → hash_alignment.rb} +8 -4
  57. data/lib/rubocop/cop/layout/{indent_heredoc.rb → heredoc_indentation.rb} +2 -2
  58. data/lib/rubocop/cop/layout/indentation_width.rb +19 -5
  59. data/lib/rubocop/cop/layout/{leading_blank_lines.rb → leading_empty_lines.rb} +1 -1
  60. data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
  61. data/lib/rubocop/cop/layout/multiline_block_layout.rb +24 -2
  62. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
  63. data/lib/rubocop/cop/layout/{align_parameters.rb → parameter_alignment.rb} +1 -1
  64. data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +2 -0
  65. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +5 -1
  66. data/lib/rubocop/cop/layout/space_around_keyword.rb +12 -0
  67. data/lib/rubocop/cop/layout/space_around_operators.rb +43 -24
  68. data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +9 -7
  69. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +8 -5
  70. data/lib/rubocop/cop/layout/space_inside_block_braces.rb +7 -0
  71. data/lib/rubocop/cop/layout/space_inside_parens.rb +6 -6
  72. data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +24 -40
  73. data/lib/rubocop/cop/layout/{trailing_blank_lines.rb → trailing_empty_lines.rb} +1 -1
  74. data/lib/rubocop/cop/layout/trailing_whitespace.rb +18 -2
  75. data/lib/rubocop/cop/lint/assignment_in_condition.rb +17 -4
  76. data/lib/rubocop/cop/lint/debugger.rb +1 -3
  77. data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +1 -1
  78. data/lib/rubocop/cop/lint/{duplicated_key.rb → duplicate_hash_key.rb} +1 -1
  79. data/lib/rubocop/cop/lint/empty_interpolation.rb +4 -4
  80. data/lib/rubocop/cop/lint/erb_new_arguments.rb +61 -4
  81. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +10 -36
  82. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +1 -1
  83. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +7 -8
  84. data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +2 -2
  85. data/lib/rubocop/cop/lint/{multiple_compare.rb → multiple_comparison.rb} +1 -1
  86. data/lib/rubocop/cop/lint/number_conversion.rb +1 -1
  87. data/lib/rubocop/cop/lint/{unneeded_cop_disable_directive.rb → redundant_cop_disable_directive.rb} +24 -24
  88. data/lib/rubocop/cop/lint/{unneeded_cop_enable_directive.rb → redundant_cop_enable_directive.rb} +6 -8
  89. data/lib/rubocop/cop/lint/{unneeded_require_statement.rb → redundant_require_statement.rb} +1 -1
  90. data/lib/rubocop/cop/lint/{unneeded_splat_expansion.rb → redundant_splat_expansion.rb} +12 -7
  91. data/lib/rubocop/cop/lint/{string_conversion_in_interpolation.rb → redundant_string_coercion.rb} +7 -7
  92. data/lib/rubocop/cop/lint/redundant_with_index.rb +2 -2
  93. data/lib/rubocop/cop/lint/redundant_with_object.rb +2 -2
  94. data/lib/rubocop/cop/lint/safe_navigation_chain.rb +5 -6
  95. data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +91 -0
  96. data/lib/rubocop/cop/lint/{handle_exceptions.rb → suppressed_exception.rb} +1 -1
  97. data/lib/rubocop/cop/lint/unused_block_argument.rb +22 -6
  98. data/lib/rubocop/cop/lint/unused_method_argument.rb +23 -5
  99. data/lib/rubocop/cop/lint/useless_access_modifier.rb +57 -23
  100. data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
  101. data/lib/rubocop/cop/lint/void.rb +7 -26
  102. data/lib/rubocop/cop/message_annotator.rb +16 -7
  103. data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
  104. data/lib/rubocop/cop/metrics/line_length.rb +48 -42
  105. data/lib/rubocop/cop/metrics/method_length.rb +1 -1
  106. data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +23 -6
  107. data/lib/rubocop/cop/migration/department_name.rb +44 -0
  108. data/lib/rubocop/cop/mixin/alignment.rb +1 -1
  109. data/lib/rubocop/cop/mixin/documentation_comment.rb +0 -2
  110. data/lib/rubocop/cop/mixin/frozen_string_literal.rb +1 -1
  111. data/lib/rubocop/cop/mixin/{hash_alignment.rb → hash_alignment_styles.rb} +1 -1
  112. data/lib/rubocop/cop/mixin/interpolation.rb +27 -0
  113. data/lib/rubocop/cop/mixin/method_complexity.rb +2 -1
  114. data/lib/rubocop/cop/mixin/nil_methods.rb +4 -4
  115. data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +87 -0
  116. data/lib/rubocop/cop/mixin/statement_modifier.rb +5 -2
  117. data/lib/rubocop/cop/mixin/surrounding_space.rb +7 -5
  118. data/lib/rubocop/cop/mixin/trailing_comma.rb +8 -6
  119. data/lib/rubocop/cop/naming/{uncommunicative_block_param_name.rb → block_parameter_name.rb} +3 -3
  120. data/lib/rubocop/cop/naming/file_name.rb +12 -5
  121. data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +5 -5
  122. data/lib/rubocop/cop/naming/method_name.rb +12 -1
  123. data/lib/rubocop/cop/naming/{uncommunicative_method_param_name.rb → method_parameter_name.rb} +3 -3
  124. data/lib/rubocop/cop/naming/predicate_name.rb +6 -6
  125. data/lib/rubocop/cop/naming/variable_name.rb +1 -0
  126. data/lib/rubocop/cop/offense.rb +18 -7
  127. data/lib/rubocop/cop/registry.rb +22 -1
  128. data/lib/rubocop/cop/style/access_modifier_declarations.rb +1 -0
  129. data/lib/rubocop/cop/style/alias.rb +1 -1
  130. data/lib/rubocop/cop/style/array_join.rb +1 -1
  131. data/lib/rubocop/cop/style/attr.rb +2 -2
  132. data/lib/rubocop/cop/style/block_delimiters.rb +2 -1
  133. data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +35 -16
  134. data/lib/rubocop/cop/style/class_and_module_children.rb +1 -1
  135. data/lib/rubocop/cop/style/comment_annotation.rb +5 -5
  136. data/lib/rubocop/cop/style/commented_keyword.rb +16 -30
  137. data/lib/rubocop/cop/style/conditional_assignment.rb +5 -7
  138. data/lib/rubocop/cop/style/constant_visibility.rb +13 -2
  139. data/lib/rubocop/cop/style/copyright.rb +11 -7
  140. data/lib/rubocop/cop/style/documentation_method.rb +44 -0
  141. data/lib/rubocop/cop/style/double_cop_disable_directive.rb +10 -4
  142. data/lib/rubocop/cop/style/empty_case_condition.rb +2 -2
  143. data/lib/rubocop/cop/style/empty_literal.rb +2 -2
  144. data/lib/rubocop/cop/style/empty_method.rb +5 -5
  145. data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
  146. data/lib/rubocop/cop/style/even_odd.rb +1 -1
  147. data/lib/rubocop/cop/style/expand_path_arguments.rb +1 -1
  148. data/lib/rubocop/cop/style/format_string.rb +10 -7
  149. data/lib/rubocop/cop/style/format_string_token.rb +19 -68
  150. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +28 -33
  151. data/lib/rubocop/cop/style/guard_clause.rb +39 -10
  152. data/lib/rubocop/cop/style/hash_syntax.rb +2 -2
  153. data/lib/rubocop/cop/style/if_unless_modifier.rb +58 -15
  154. data/lib/rubocop/cop/style/infinite_loop.rb +5 -4
  155. data/lib/rubocop/cop/style/inverse_methods.rb +19 -13
  156. data/lib/rubocop/cop/style/ip_addresses.rb +4 -4
  157. data/lib/rubocop/cop/style/lambda.rb +0 -2
  158. data/lib/rubocop/cop/style/line_end_concatenation.rb +14 -10
  159. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +25 -25
  160. data/lib/rubocop/cop/style/method_def_parentheses.rb +17 -9
  161. data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
  162. data/lib/rubocop/cop/style/mixin_usage.rb +11 -1
  163. data/lib/rubocop/cop/style/multiline_memoization.rb +1 -1
  164. data/lib/rubocop/cop/style/multiline_when_then.rb +1 -1
  165. data/lib/rubocop/cop/style/nested_modifier.rb +22 -4
  166. data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +5 -5
  167. data/lib/rubocop/cop/style/next.rb +5 -5
  168. data/lib/rubocop/cop/style/non_nil_check.rb +21 -9
  169. data/lib/rubocop/cop/style/numeric_literals.rb +7 -3
  170. data/lib/rubocop/cop/style/option_hash.rb +3 -3
  171. data/lib/rubocop/cop/style/or_assignment.rb +6 -1
  172. data/lib/rubocop/cop/style/parentheses_around_condition.rb +14 -0
  173. data/lib/rubocop/cop/style/{unneeded_capital_w.rb → redundant_capital_w.rb} +1 -1
  174. data/lib/rubocop/cop/style/{unneeded_condition.rb → redundant_condition.rb} +3 -3
  175. data/lib/rubocop/cop/style/{unneeded_interpolation.rb → redundant_interpolation.rb} +1 -1
  176. data/lib/rubocop/cop/style/redundant_parentheses.rb +16 -7
  177. data/lib/rubocop/cop/style/{unneeded_percent_q.rb → redundant_percent_q.rb} +1 -1
  178. data/lib/rubocop/cop/style/redundant_return.rb +39 -29
  179. data/lib/rubocop/cop/style/redundant_self.rb +18 -1
  180. data/lib/rubocop/cop/style/{unneeded_sort.rb → redundant_sort.rb} +5 -5
  181. data/lib/rubocop/cop/style/rescue_modifier.rb +24 -0
  182. data/lib/rubocop/cop/style/safe_navigation.rb +23 -3
  183. data/lib/rubocop/cop/style/semicolon.rb +13 -2
  184. data/lib/rubocop/cop/style/single_line_methods.rb +8 -1
  185. data/lib/rubocop/cop/style/special_global_vars.rb +5 -7
  186. data/lib/rubocop/cop/style/ternary_parentheses.rb +19 -0
  187. data/lib/rubocop/cop/style/trailing_method_end_statement.rb +4 -6
  188. data/lib/rubocop/cop/style/trivial_accessors.rb +5 -5
  189. data/lib/rubocop/cop/style/variable_interpolation.rb +6 -16
  190. data/lib/rubocop/cop/team.rb +5 -0
  191. data/lib/rubocop/cop/util.rb +1 -1
  192. data/lib/rubocop/cop/utils/format_string.rb +120 -0
  193. data/lib/rubocop/cop/variable_force.rb +7 -5
  194. data/lib/rubocop/cop/variable_force/variable.rb +15 -2
  195. data/lib/rubocop/core_ext/string.rb +0 -24
  196. data/lib/rubocop/formatter/clang_style_formatter.rb +9 -6
  197. data/lib/rubocop/formatter/emacs_style_formatter.rb +22 -9
  198. data/lib/rubocop/formatter/file_list_formatter.rb +1 -1
  199. data/lib/rubocop/formatter/formatter_set.rb +16 -15
  200. data/lib/rubocop/formatter/pacman_formatter.rb +80 -0
  201. data/lib/rubocop/formatter/simple_text_formatter.rb +16 -4
  202. data/lib/rubocop/formatter/tap_formatter.rb +18 -7
  203. data/lib/rubocop/magic_comment.rb +4 -0
  204. data/lib/rubocop/node_pattern.rb +3 -1
  205. data/lib/rubocop/options.rb +17 -22
  206. data/lib/rubocop/path_util.rb +1 -1
  207. data/lib/rubocop/processed_source.rb +5 -1
  208. data/lib/rubocop/rake_task.rb +1 -0
  209. data/lib/rubocop/result_cache.rb +22 -8
  210. data/lib/rubocop/rspec/expect_offense.rb +4 -1
  211. data/lib/rubocop/runner.rb +55 -32
  212. data/lib/rubocop/target_finder.rb +12 -6
  213. data/lib/rubocop/version.rb +1 -1
  214. metadata +47 -32
  215. data/lib/rubocop/cop/mixin/ignored_method_patterns.rb +0 -19
  216. data/lib/rubocop/cop/mixin/safe_mode.rb +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65d141c7453c4d515c8e6a54e88cbc82305193f9fdd078148939550973c06eef
4
- data.tar.gz: 78246e2ffa87ef9a0206e73227f323bfd9d1fdf97f565660c12f52854d2e75f0
3
+ metadata.gz: 8789393bf78c1ae637e196f15a3b312a261b8239996ce92bcd99670ab358bea0
4
+ data.tar.gz: 6b1e83fe89bcd3e003ea5f95307d212b3e5adce496ddc26dfe6ff92ea4dc3356
5
5
  SHA512:
6
- metadata.gz: 48f6c20451589a69ebf28b1dacb70193d9baa0b6a5c6a5f2c065c00df2a7df284575705ac65027f4884b0673d1b62babf862ad2c9bdb461f909c4b38cb15a138
7
- data.tar.gz: ea5877d8c872db2adf5f45e6613d01881227b7a22394c8e661fb41e78b5a9d75fb2662471a1876f287718092120ef2953105f27392c2a741273f9dd131544b29
6
+ metadata.gz: d0a92b3b466939337e7d100d255a9c08ff7db25c235c3645ad65e878151899000749a5e20b01eda2be3ec7e4384272cfed2dce12053dd87df4b01be83453c3d9
7
+ data.tar.gz: d646dad7e86dcacd75a286f70c2843934acb9a7416a40edec51fa373d9f0b3da05f74eac21ad869c24b92b550e2efb66cdf0229dc6ef2fb772edc7a7a6ee5107
data/README.md CHANGED
@@ -9,6 +9,7 @@
9
9
  [![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov)
10
10
  [![OpenCollective](https://opencollective.com/rubocop/backers/badge.svg)](#open-collective-backers)
11
11
  [![OpenCollective](https://opencollective.com/rubocop/sponsors/badge.svg)](#open-collective-sponsors)
12
+ [![Tidelift](https://tidelift.com/badges/package/rubygems/rubocop)](https://tidelift.com/subscription/pkg/rubygems-rubocop?utm_source=rubygems-rubocop&utm_medium=referral&utm_campaign=readme)
12
13
 
13
14
  <p align="center">
14
15
  <img src="https://raw.githubusercontent.com/rubocop-hq/rubocop/master/logo/rubo-logo-horizontal.png" alt="RuboCop Logo"/>
@@ -52,7 +53,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
52
53
  might want to use a conservative version lock in your `Gemfile`:
53
54
 
54
55
  ```rb
55
- gem 'rubocop', '~> 0.73.0', require: false
56
+ gem 'rubocop', '~> 0.77.0', require: false
56
57
  ```
57
58
 
58
59
  ## Quickstart
@@ -73,7 +74,7 @@ You can read a lot more about RuboCop in its [official docs](https://docs.ruboco
73
74
  RuboCop supports the following Ruby implementations:
74
75
 
75
76
  * MRI 2.3+
76
- * JRuby 9.1+
77
+ * JRuby 9.2+
77
78
 
78
79
  ## Team
79
80
 
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ require 'bundler/setup'
4
5
  require 'pry'
5
6
  require 'rubocop'
6
7
 
@@ -141,11 +141,12 @@ Bundler/GemComment:
141
141
  Description: 'Add a comment describing each gem.'
142
142
  Enabled: false
143
143
  VersionAdded: '0.59'
144
+ VersionChanged: '0.77'
144
145
  Include:
145
146
  - '**/*.gemfile'
146
147
  - '**/Gemfile'
147
148
  - '**/gems.rb'
148
- Whitelist: []
149
+ IgnoredGems: []
149
150
 
150
151
  Bundler/InsecureProtocolSource:
151
152
  Description: >-
@@ -218,13 +219,14 @@ Layout/AccessModifierIndentation:
218
219
  # But it can be overridden by setting this parameter
219
220
  IndentationWidth: ~
220
221
 
221
- Layout/AlignArguments:
222
+ Layout/ArgumentAlignment:
222
223
  Description: >-
223
224
  Align the arguments of a method call if they span more
224
225
  than one line.
225
226
  StyleGuide: '#no-double-indent'
226
227
  Enabled: true
227
228
  VersionAdded: '0.68'
229
+ VersionChanged: '0.77'
228
230
  # Alignment of arguments in multi-line method calls.
229
231
  #
230
232
  # The `with_first_argument` style aligns the following lines along the same
@@ -246,117 +248,23 @@ Layout/AlignArguments:
246
248
  # But it can be overridden by setting this parameter
247
249
  IndentationWidth: ~
248
250
 
249
- Layout/AlignArray:
251
+ Layout/ArrayAlignment:
250
252
  Description: >-
251
253
  Align the elements of an array literal if they span more than
252
254
  one line.
253
255
  StyleGuide: '#align-multiline-arrays'
254
256
  Enabled: true
255
257
  VersionAdded: '0.49'
258
+ VersionChanged: '0.77'
256
259
 
257
- Layout/AlignHash:
260
+ Layout/AssignmentIndentation:
258
261
  Description: >-
259
- Align the elements of a hash literal if they span more than
260
- one line.
262
+ Checks the indentation of the first line of the
263
+ right-hand-side of a multi-line assignment.
261
264
  Enabled: true
262
- AllowMultipleStyles: true
263
265
  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
266
+ VersionChanged: '0.77'
267
+ # By default, the indentation width from `Layout/IndentationWidth` is used
360
268
  # But it can be overridden by setting this parameter
361
269
  IndentationWidth: ~
362
270
 
@@ -624,56 +532,11 @@ Layout/ExtraSpacing:
624
532
  # When true, forces the alignment of `=` in assignments on consecutive lines.
625
533
  ForceEqualSignAlignment: false
626
534
 
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:
535
+ Layout/FirstArgumentIndentation:
674
536
  Description: 'Checks the indentation of the first argument in a method call.'
675
537
  Enabled: true
676
538
  VersionAdded: '0.68'
539
+ VersionChanged: '0.77'
677
540
  EnforcedStyle: special_for_inner_method_call_in_parentheses
678
541
  SupportedStyles:
679
542
  # The first parameter should always be indented one step more than the
@@ -694,12 +557,13 @@ Layout/IndentFirstArgument:
694
557
  # But it can be overridden by setting this parameter
695
558
  IndentationWidth: ~
696
559
 
697
- Layout/IndentFirstArrayElement:
560
+ Layout/FirstArrayElementIndentation:
698
561
  Description: >-
699
562
  Checks the indentation of the first element in an array
700
563
  literal.
701
564
  Enabled: true
702
565
  VersionAdded: '0.68'
566
+ VersionChanged: '0.77'
703
567
  # The value `special_inside_parentheses` means that array literals with
704
568
  # brackets that have their opening bracket on the same line as a surrounding
705
569
  # opening round parenthesis, shall have their first element indented relative
@@ -720,10 +584,18 @@ Layout/IndentFirstArrayElement:
720
584
  # But it can be overridden by setting this parameter
721
585
  IndentationWidth: ~
722
586
 
723
- Layout/IndentFirstHashElement:
587
+ Layout/FirstArrayElementLineBreak:
588
+ Description: >-
589
+ Checks for a line break before the first element in a
590
+ multi-line array.
591
+ Enabled: false
592
+ VersionAdded: '0.49'
593
+
594
+ Layout/FirstHashElementIndentation:
724
595
  Description: 'Checks the indentation of the first key in a hash literal.'
725
596
  Enabled: true
726
597
  VersionAdded: '0.68'
598
+ VersionChanged: '0.77'
727
599
  # The value `special_inside_parentheses` means that hash literals with braces
728
600
  # that have their opening brace on the same line as a surrounding opening
729
601
  # round parenthesis, shall have their first key indented relative to the
@@ -744,13 +616,34 @@ Layout/IndentFirstHashElement:
744
616
  # But it can be overridden by setting this parameter
745
617
  IndentationWidth: ~
746
618
 
747
- Layout/IndentFirstParameter:
619
+ Layout/FirstHashElementLineBreak:
620
+ Description: >-
621
+ Checks for a line break before the first element in a
622
+ multi-line hash.
623
+ Enabled: false
624
+ VersionAdded: '0.49'
625
+
626
+ Layout/FirstMethodArgumentLineBreak:
627
+ Description: >-
628
+ Checks for a line break before the first argument in a
629
+ multi-line method call.
630
+ Enabled: false
631
+ VersionAdded: '0.49'
632
+
633
+ Layout/FirstMethodParameterLineBreak:
634
+ Description: >-
635
+ Checks for a line break before the first parameter in a
636
+ multi-line method parameter definition.
637
+ Enabled: false
638
+ VersionAdded: '0.49'
639
+
640
+ Layout/FirstParameterIndentation:
748
641
  Description: >-
749
642
  Checks the indentation of the first parameter in a
750
643
  method definition.
751
644
  Enabled: true
752
645
  VersionAdded: '0.49'
753
- VersionChanged: '0.68'
646
+ VersionChanged: '0.77'
754
647
  EnforcedStyle: consistent
755
648
  SupportedStyles:
756
649
  - consistent
@@ -759,12 +652,98 @@ Layout/IndentFirstParameter:
759
652
  # But it can be overridden by setting this parameter
760
653
  IndentationWidth: ~
761
654
 
762
- Layout/IndentHeredoc:
655
+ Layout/HashAlignment:
656
+ Description: >-
657
+ Align the elements of a hash literal if they span more than
658
+ one line.
659
+ Enabled: true
660
+ AllowMultipleStyles: true
661
+ VersionAdded: '0.49'
662
+ VersionChanged: '0.77'
663
+ # Alignment of entries using hash rocket as separator. Valid values are:
664
+ #
665
+ # key - left alignment of keys
666
+ # 'a' => 2
667
+ # 'bb' => 3
668
+ # separator - alignment of hash rockets, keys are right aligned
669
+ # 'a' => 2
670
+ # 'bb' => 3
671
+ # table - left alignment of keys, hash rockets, and values
672
+ # 'a' => 2
673
+ # 'bb' => 3
674
+ EnforcedHashRocketStyle: key
675
+ SupportedHashRocketStyles:
676
+ - key
677
+ - separator
678
+ - table
679
+ # Alignment of entries using colon as separator. Valid values are:
680
+ #
681
+ # key - left alignment of keys
682
+ # a: 0
683
+ # bb: 1
684
+ # separator - alignment of colons, keys are right aligned
685
+ # a: 0
686
+ # bb: 1
687
+ # table - left alignment of keys and values
688
+ # a: 0
689
+ # bb: 1
690
+ EnforcedColonStyle: key
691
+ SupportedColonStyles:
692
+ - key
693
+ - separator
694
+ - table
695
+ # Select whether hashes that are the last argument in a method call should be
696
+ # inspected? Valid values are:
697
+ #
698
+ # always_inspect - Inspect both implicit and explicit hashes.
699
+ # Registers an offense for:
700
+ # function(a: 1,
701
+ # b: 2)
702
+ # Registers an offense for:
703
+ # function({a: 1,
704
+ # b: 2})
705
+ # always_ignore - Ignore both implicit and explicit hashes.
706
+ # Accepts:
707
+ # function(a: 1,
708
+ # b: 2)
709
+ # Accepts:
710
+ # function({a: 1,
711
+ # b: 2})
712
+ # ignore_implicit - Ignore only implicit hashes.
713
+ # Accepts:
714
+ # function(a: 1,
715
+ # b: 2)
716
+ # Registers an offense for:
717
+ # function({a: 1,
718
+ # b: 2})
719
+ # ignore_explicit - Ignore only explicit hashes.
720
+ # Accepts:
721
+ # function({a: 1,
722
+ # b: 2})
723
+ # Registers an offense for:
724
+ # function(a: 1,
725
+ # b: 2)
726
+ EnforcedLastArgumentHashStyle: always_inspect
727
+ SupportedLastArgumentHashStyles:
728
+ - always_inspect
729
+ - always_ignore
730
+ - ignore_implicit
731
+ - ignore_explicit
732
+
733
+ Layout/HeredocArgumentClosingParenthesis:
734
+ Description: >-
735
+ Checks for the placement of the closing parenthesis in a
736
+ method call that passes a HEREDOC string as an argument.
737
+ Enabled: false
738
+ StyleGuide: '#heredoc-argument-closing-parentheses'
739
+ VersionAdded: '0.68'
740
+
741
+ Layout/HeredocIndentation:
763
742
  Description: 'This cop checks the indentation of the here document bodies.'
764
743
  StyleGuide: '#squiggly-heredocs'
765
744
  Enabled: true
766
745
  VersionAdded: '0.49'
767
- VersionChanged: '0.69'
746
+ VersionChanged: '0.77'
768
747
  EnforcedStyle: squiggly
769
748
  SupportedStyles:
770
749
  - squiggly
@@ -806,11 +785,6 @@ Layout/InitialIndentation:
806
785
  Enabled: true
807
786
  VersionAdded: '0.49'
808
787
 
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
788
  Layout/LeadingCommentSpace:
815
789
  Description: 'Comments should start with a space.'
816
790
  StyleGuide: '#hash-space'
@@ -819,6 +793,12 @@ Layout/LeadingCommentSpace:
819
793
  VersionChanged: '0.73'
820
794
  AllowDoxygenCommentStyle: false
821
795
 
796
+ Layout/LeadingEmptyLines:
797
+ Description: Check for unnecessary blank lines at the beginning of a file.
798
+ Enabled: true
799
+ VersionAdded: '0.57'
800
+ VersionChanged: '0.77'
801
+
822
802
  Layout/MultilineArrayBraceLayout:
823
803
  Description: >-
824
804
  Checks that the closing brace in an array literal is
@@ -960,6 +940,35 @@ Layout/MultilineOperationIndentation:
960
940
  # But it can be overridden by setting this parameter
961
941
  IndentationWidth: ~
962
942
 
943
+ Layout/ParameterAlignment:
944
+ Description: >-
945
+ Align the parameters of a method definition if they span more
946
+ than one line.
947
+ StyleGuide: '#no-double-indent'
948
+ Enabled: true
949
+ VersionAdded: '0.49'
950
+ VersionChanged: '0.77'
951
+ # Alignment of parameters in multi-line method calls.
952
+ #
953
+ # The `with_first_parameter` style aligns the following lines along the same
954
+ # column as the first parameter.
955
+ #
956
+ # def method_foo(a,
957
+ # b)
958
+ #
959
+ # The `with_fixed_indentation` style aligns the following lines with one
960
+ # level of indentation relative to the start of the line with the method call.
961
+ #
962
+ # def method_foo(a,
963
+ # b)
964
+ EnforcedStyle: with_first_parameter
965
+ SupportedStyles:
966
+ - with_first_parameter
967
+ - with_fixed_indentation
968
+ # By default, the indentation width from Layout/IndentationWidth is used
969
+ # But it can be overridden by setting this parameter
970
+ IndentationWidth: ~
971
+
963
972
  Layout/RescueEnsureAlignment:
964
973
  Description: 'Align rescues and ensures correctly.'
965
974
  Enabled: true
@@ -1202,11 +1211,12 @@ Layout/Tab:
1202
1211
  # replace each tab.
1203
1212
  IndentationWidth: ~
1204
1213
 
1205
- Layout/TrailingBlankLines:
1214
+ Layout/TrailingEmptyLines:
1206
1215
  Description: 'Checks trailing blank lines and final newline.'
1207
1216
  StyleGuide: '#newline-eof'
1208
1217
  Enabled: true
1209
1218
  VersionAdded: '0.49'
1219
+ VersionChanged: '0.77'
1210
1220
  EnforcedStyle: final_newline
1211
1221
  SupportedStyles:
1212
1222
  - final_newline
@@ -1290,16 +1300,17 @@ Lint/DuplicateCaseCondition:
1290
1300
  Enabled: true
1291
1301
  VersionAdded: '0.45'
1292
1302
 
1303
+ Lint/DuplicateHashKey:
1304
+ Description: 'Check for duplicate keys in hash literals.'
1305
+ Enabled: true
1306
+ VersionAdded: '0.34'
1307
+ VersionChanged: '0.77'
1308
+
1293
1309
  Lint/DuplicateMethods:
1294
1310
  Description: 'Check for duplicate method definitions.'
1295
1311
  Enabled: true
1296
1312
  VersionAdded: '0.29'
1297
1313
 
1298
- Lint/DuplicatedKey:
1299
- Description: 'Check for duplicate keys in hash literals.'
1300
- Enabled: true
1301
- VersionAdded: '0.34'
1302
-
1303
1314
  Lint/EachWithObjectArgument:
1304
1315
  Description: 'Check for immutable argument given to each_with_object.'
1305
1316
  Enabled: true
@@ -1367,14 +1378,6 @@ Lint/FormatParameterMismatch:
1367
1378
  Enabled: true
1368
1379
  VersionAdded: '0.33'
1369
1380
 
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
1381
  Lint/HeredocMethodCallPosition:
1379
1382
  Description: >-
1380
1383
  Checks for the ordering of a method call where
@@ -1444,10 +1447,11 @@ Lint/MissingCopEnableDirective:
1444
1447
  # .inf for any size
1445
1448
  MaximumRangeSize: .inf
1446
1449
 
1447
- Lint/MultipleCompare:
1448
- Description: "Use `&&` operator to compare multiple value."
1450
+ Lint/MultipleComparison:
1451
+ Description: "Use `&&` operator to compare multiple values."
1449
1452
  Enabled: true
1450
1453
  VersionAdded: '0.47'
1454
+ VersionChanged: '0.77'
1451
1455
 
1452
1456
  Lint/NestedMethodDefinition:
1453
1457
  Description: 'Do not use nested method definitions.'
@@ -1512,6 +1516,36 @@ Lint/RandOne:
1512
1516
  Enabled: true
1513
1517
  VersionAdded: '0.36'
1514
1518
 
1519
+ Lint/RedundantCopDisableDirective:
1520
+ Description: >-
1521
+ Checks for rubocop:disable comments that can be removed.
1522
+ Note: this cop is not disabled when disabling all cops.
1523
+ It must be explicitly disabled.
1524
+ Enabled: true
1525
+ VersionAdded: '0.76'
1526
+
1527
+ Lint/RedundantCopEnableDirective:
1528
+ Description: Checks for rubocop:enable comments that can be removed.
1529
+ Enabled: true
1530
+ VersionAdded: '0.76'
1531
+
1532
+ Lint/RedundantRequireStatement:
1533
+ Description: 'Checks for unnecessary `require` statement.'
1534
+ Enabled: true
1535
+ VersionAdded: '0.76'
1536
+
1537
+ Lint/RedundantSplatExpansion:
1538
+ Description: 'Checks for splat unnecessarily being called on literals.'
1539
+ Enabled: true
1540
+ VersionChanged: '0.76'
1541
+
1542
+ Lint/RedundantStringCoercion:
1543
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1544
+ StyleGuide: '#no-to-s'
1545
+ Enabled: true
1546
+ VersionAdded: '0.19'
1547
+ VersionChanged: '0.77'
1548
+
1515
1549
  Lint/RedundantWithIndex:
1516
1550
  Description: 'Checks for redundant `with_index`.'
1517
1551
  Enabled: true
@@ -1557,8 +1591,8 @@ Lint/SafeNavigationChain:
1557
1591
  Description: 'Do not chain ordinary method call after safe navigation operator.'
1558
1592
  Enabled: true
1559
1593
  VersionAdded: '0.47'
1560
- VersionChanged: '0.56'
1561
- Whitelist:
1594
+ VersionChanged: '0.77'
1595
+ AllowedMethods:
1562
1596
  - present?
1563
1597
  - blank?
1564
1598
  - presence
@@ -1572,14 +1606,14 @@ Lint/SafeNavigationConsistency:
1572
1606
  for all method calls on that same object.
1573
1607
  Enabled: true
1574
1608
  VersionAdded: '0.55'
1575
- Whitelist:
1609
+ VersionChanged: '0.77'
1610
+ AllowedMethods:
1576
1611
  - present?
1577
1612
  - blank?
1578
1613
  - presence
1579
1614
  - try
1580
1615
  - try!
1581
1616
 
1582
-
1583
1617
  Lint/SafeNavigationWithEmpty:
1584
1618
  Description: 'Avoid `foo&.empty?` in conditionals.'
1585
1619
  Enabled: true
@@ -1591,6 +1625,11 @@ Lint/ScriptPermission:
1591
1625
  VersionAdded: '0.49'
1592
1626
  VersionChanged: '0.50'
1593
1627
 
1628
+ Lint/SendWithMixinArgument:
1629
+ Description: 'Checks for `send` method when using mixin.'
1630
+ Enabled: true
1631
+ VersionAdded: '0.75'
1632
+
1594
1633
  Lint/ShadowedArgument:
1595
1634
  Description: 'Avoid reassigning arguments before they were used.'
1596
1635
  Enabled: true
@@ -1612,12 +1651,13 @@ Lint/ShadowingOuterLocalVariable:
1612
1651
  Enabled: true
1613
1652
  VersionAdded: '0.9'
1614
1653
 
1615
- Lint/StringConversionInInterpolation:
1616
- Description: 'Checks for Object#to_s usage in string interpolation.'
1617
- StyleGuide: '#no-to-s'
1654
+ Lint/SuppressedException:
1655
+ Description: "Don't suppress exceptions."
1656
+ StyleGuide: '#dont-hide-exceptions'
1618
1657
  Enabled: true
1619
- VersionAdded: '0.19'
1620
- VersionChanged: '0.20'
1658
+ AllowComments: false
1659
+ VersionAdded: '0.9'
1660
+ VersionChanged: '0.77'
1621
1661
 
1622
1662
  Lint/Syntax:
1623
1663
  Description: 'Checks syntax error.'
@@ -1640,29 +1680,6 @@ Lint/UnifiedInteger:
1640
1680
  Enabled: true
1641
1681
  VersionAdded: '0.43'
1642
1682
 
1643
- Lint/UnneededCopDisableDirective:
1644
- Description: >-
1645
- Checks for rubocop:disable comments that can be removed.
1646
- Note: this cop is not disabled when disabling all cops.
1647
- It must be explicitly disabled.
1648
- Enabled: true
1649
- VersionAdded: '0.53'
1650
-
1651
- Lint/UnneededCopEnableDirective:
1652
- Description: Checks for rubocop:enable comments that can be removed.
1653
- Enabled: true
1654
- VersionAdded: '0.53'
1655
-
1656
- Lint/UnneededRequireStatement:
1657
- Description: 'Checks for unnecessary `require` statement.'
1658
- Enabled: true
1659
- VersionAdded: '0.51'
1660
-
1661
- Lint/UnneededSplatExpansion:
1662
- Description: 'Checks for splat unnecessarily being called on literals.'
1663
- Enabled: true
1664
- VersionAdded: '0.43'
1665
-
1666
1683
  Lint/UnreachableCode:
1667
1684
  Description: 'Unreachable code.'
1668
1685
  Enabled: true
@@ -1745,7 +1762,7 @@ Metrics/AbcSize:
1745
1762
  branches, and conditions.
1746
1763
  Reference:
1747
1764
  - http://c2.com/cgi/wiki?AbcMetric
1748
- - https://en.wikipedia.org/wiki/ABC_Software_Metric'
1765
+ - https://en.wikipedia.org/wiki/ABC_Software_Metric
1749
1766
  Enabled: true
1750
1767
  VersionAdded: '0.27'
1751
1768
  VersionChanged: '0.66'
@@ -1809,7 +1826,7 @@ Metrics/LineLength:
1809
1826
  - https
1810
1827
  # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1811
1828
  # directives like '# rubocop: enable ...' when calculating a line's length.
1812
- IgnoreCopDirectives: false
1829
+ IgnoreCopDirectives: true
1813
1830
  # The IgnoredPatterns option is a list of !ruby/regexp and/or string
1814
1831
  # elements. Strings will be converted to Regexp objects. A line that matches
1815
1832
  # any regular expression listed in this option will be ignored by LineLength.
@@ -1848,6 +1865,14 @@ Metrics/PerceivedComplexity:
1848
1865
  VersionAdded: '0.25'
1849
1866
  Max: 7
1850
1867
 
1868
+ ################## Migration #############################
1869
+
1870
+ Migration/DepartmentName:
1871
+ Description: >-
1872
+ Check that cop names in rubocop:disable (etc) comments are
1873
+ given with department name.
1874
+ Enabled: false
1875
+
1851
1876
  #################### Naming ##############################
1852
1877
 
1853
1878
  Naming/AccessorMethodName:
@@ -1868,6 +1893,21 @@ Naming/BinaryOperatorParameterName:
1868
1893
  Enabled: true
1869
1894
  VersionAdded: '0.50'
1870
1895
 
1896
+ Naming/BlockParameterName:
1897
+ Description: >-
1898
+ Checks for block parameter names that contain capital letters,
1899
+ end in numbers, or do not meet a minimal length.
1900
+ Enabled: true
1901
+ VersionAdded: '0.53'
1902
+ VersionChanged: '0.77'
1903
+ # Parameter names may be equal to or greater than this value
1904
+ MinNameLength: 1
1905
+ AllowNamesEndingInNumbers: true
1906
+ # Allowed names that will not register an offense
1907
+ AllowedNames: []
1908
+ # Forbidden names that will register an offense
1909
+ ForbiddenNames: []
1910
+
1871
1911
  Naming/ClassAndModuleCamelCase:
1872
1912
  Description: 'Use CamelCase for classes and modules.'
1873
1913
  StyleGuide: '#camelcase-classes'
@@ -1959,7 +1999,7 @@ Naming/HeredocDelimiterNaming:
1959
1999
  StyleGuide: '#heredoc-delimiters'
1960
2000
  Enabled: true
1961
2001
  VersionAdded: '0.50'
1962
- Blacklist:
2002
+ ForbiddenDelimiters:
1963
2003
  - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
1964
2004
 
1965
2005
  Naming/MemoizedInstanceVariableName:
@@ -1983,26 +2023,58 @@ Naming/MethodName:
1983
2023
  SupportedStyles:
1984
2024
  - snake_case
1985
2025
  - camelCase
2026
+ # Method names matching patterns are always allowed.
2027
+ #
2028
+ # IgnoredPatterns:
2029
+ # - '\A\s*onSelectionBulkChange\s*'
2030
+ # - '\A\s*onSelectionCleared\s*'
2031
+ #
2032
+ IgnoredPatterns: []
2033
+
2034
+ Naming/MethodParameterName:
2035
+ Description: >-
2036
+ Checks for method parameter names that contain capital letters,
2037
+ end in numbers, or do not meet a minimal length.
2038
+ Enabled: true
2039
+ VersionAdded: '0.53'
2040
+ VersionChanged: '0.77'
2041
+ # Parameter names may be equal to or greater than this value
2042
+ MinNameLength: 3
2043
+ AllowNamesEndingInNumbers: true
2044
+ # Allowed names that will not register an offense
2045
+ AllowedNames:
2046
+ - io
2047
+ - id
2048
+ - to
2049
+ - by
2050
+ - 'on'
2051
+ - in
2052
+ - at
2053
+ - ip
2054
+ - db
2055
+ - os
2056
+ # Forbidden names that will register an offense
2057
+ ForbiddenNames: []
1986
2058
 
1987
2059
  Naming/PredicateName:
1988
2060
  Description: 'Check the names of predicate methods.'
1989
2061
  StyleGuide: '#bool-methods-qmark'
1990
2062
  Enabled: true
1991
2063
  VersionAdded: '0.50'
1992
- VersionChanged: '0.51'
2064
+ VersionChanged: '0.77'
1993
2065
  # Predicate name prefixes.
1994
2066
  NamePrefix:
1995
2067
  - is_
1996
2068
  - has_
1997
2069
  - have_
1998
2070
  # Predicate name prefixes that should be removed.
1999
- NamePrefixBlacklist:
2071
+ ForbiddenPrefixes:
2000
2072
  - is_
2001
2073
  - has_
2002
2074
  - have_
2003
- # Predicate names which, despite having a blacklisted prefix, or no `?`,
2075
+ # Predicate names which, despite having a forbidden prefix, or no `?`,
2004
2076
  # should still be accepted
2005
- NameWhitelist:
2077
+ AllowedMethods:
2006
2078
  - is_a?
2007
2079
  # Method definition macros for dynamically generated methods.
2008
2080
  MethodDefinitionMacros:
@@ -2020,45 +2092,6 @@ Naming/RescuedExceptionsVariableName:
2020
2092
  VersionChanged: '0.68'
2021
2093
  PreferredName: e
2022
2094
 
2023
- Naming/UncommunicativeBlockParamName:
2024
- Description: >-
2025
- Checks for block parameter names that contain capital letters,
2026
- end in numbers, or do not meet a minimal length.
2027
- Enabled: true
2028
- VersionAdded: '0.53'
2029
- # Parameter names may be equal to or greater than this value
2030
- MinNameLength: 1
2031
- AllowNamesEndingInNumbers: true
2032
- # Whitelisted names that will not register an offense
2033
- AllowedNames: []
2034
- # Blacklisted names that will register an offense
2035
- ForbiddenNames: []
2036
-
2037
- Naming/UncommunicativeMethodParamName:
2038
- Description: >-
2039
- Checks for method parameter names that contain capital letters,
2040
- end in numbers, or do not meet a minimal length.
2041
- Enabled: true
2042
- VersionAdded: '0.53'
2043
- VersionChanged: '0.59'
2044
- # Parameter names may be equal to or greater than this value
2045
- MinNameLength: 3
2046
- AllowNamesEndingInNumbers: true
2047
- # Whitelisted names that will not register an offense
2048
- AllowedNames:
2049
- - io
2050
- - id
2051
- - to
2052
- - by
2053
- - 'on'
2054
- - in
2055
- - at
2056
- - ip
2057
- - db
2058
- # Blacklisted names that will register an offense
2059
- ForbiddenNames: []
2060
-
2061
-
2062
2095
  Naming/VariableName:
2063
2096
  Description: 'Use the configured style when naming variables.'
2064
2097
  StyleGuide: '#snake-case-symbols-methods-vars'
@@ -2705,7 +2738,7 @@ Style/FormatStringToken:
2705
2738
  - template
2706
2739
  - unannotated
2707
2740
  VersionAdded: '0.49'
2708
- VersionChanged: '0.52'
2741
+ VersionChanged: '0.75'
2709
2742
 
2710
2743
  Style/FrozenStringLiteralComment:
2711
2744
  Description: >-
@@ -2853,8 +2886,9 @@ Style/IpAddresses:
2853
2886
  Description: "Don't include literal IP addresses in code."
2854
2887
  Enabled: false
2855
2888
  VersionAdded: '0.58'
2856
- # Allow strings to be whitelisted
2857
- Whitelist:
2889
+ VersionChanged: '0.77'
2890
+ # Allow addresses to be permitted
2891
+ AllowedAddresses:
2858
2892
  - "::"
2859
2893
  # :: is a valid IPv6 address, but could potentially be legitimately in code
2860
2894
 
@@ -2898,6 +2932,7 @@ Style/MethodCallWithArgsParentheses:
2898
2932
  VersionChanged: '0.61'
2899
2933
  IgnoreMacros: true
2900
2934
  IgnoredMethods: []
2935
+ IgnoredPatterns: []
2901
2936
  IncludedMacros: []
2902
2937
  AllowParenthesesInMultilineCall: false
2903
2938
  AllowParenthesesInChaining: false
@@ -3052,7 +3087,7 @@ Style/MultilineWhenThen:
3052
3087
  Description: 'Do not use then for multi-line when statement.'
3053
3088
  StyleGuide: '#no-then'
3054
3089
  Enabled: true
3055
- VersionAdded: '0.72'
3090
+ VersionAdded: '0.73'
3056
3091
 
3057
3092
  Style/MultipleComparison:
3058
3093
  Description: >-
@@ -3126,8 +3161,8 @@ Style/NestedParenthesizedCalls:
3126
3161
  argument list of another parenthesized method call.
3127
3162
  Enabled: true
3128
3163
  VersionAdded: '0.36'
3129
- VersionChanged: '0.50'
3130
- Whitelist:
3164
+ VersionChanged: '0.77'
3165
+ AllowedMethods:
3131
3166
  - be
3132
3167
  - be_a
3133
3168
  - be_an
@@ -3380,6 +3415,16 @@ Style/RedundantBegin:
3380
3415
  VersionAdded: '0.10'
3381
3416
  VersionChanged: '0.21'
3382
3417
 
3418
+ Style/RedundantCapitalW:
3419
+ Description: 'Checks for %W when interpolation is not needed.'
3420
+ Enabled: true
3421
+ VersionAdded: '0.76'
3422
+
3423
+ Style/RedundantCondition:
3424
+ Description: 'Checks for unnecessary conditional expressions.'
3425
+ Enabled: true
3426
+ VersionAdded: '0.76'
3427
+
3383
3428
  Style/RedundantConditional:
3384
3429
  Description: "Don't return true/false from a conditional."
3385
3430
  Enabled: true
@@ -3398,11 +3443,22 @@ Style/RedundantFreeze:
3398
3443
  VersionAdded: '0.34'
3399
3444
  VersionChanged: '0.66'
3400
3445
 
3446
+ Style/RedundantInterpolation:
3447
+ Description: 'Checks for strings that are just an interpolated expression.'
3448
+ Enabled: true
3449
+ VersionAdded: '0.76'
3450
+
3401
3451
  Style/RedundantParentheses:
3402
3452
  Description: "Checks for parentheses that seem not to serve any purpose."
3403
3453
  Enabled: true
3404
3454
  VersionAdded: '0.36'
3405
3455
 
3456
+ Style/RedundantPercentQ:
3457
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
3458
+ StyleGuide: '#percent-q'
3459
+ Enabled: true
3460
+ VersionAdded: '0.76'
3461
+
3406
3462
  Style/RedundantReturn:
3407
3463
  Description: "Don't use return where it's not required."
3408
3464
  StyleGuide: '#no-explicit-return'
@@ -3419,6 +3475,13 @@ Style/RedundantSelf:
3419
3475
  VersionAdded: '0.10'
3420
3476
  VersionChanged: '0.13'
3421
3477
 
3478
+ Style/RedundantSort:
3479
+ Description: >-
3480
+ Use `min` instead of `sort.first`,
3481
+ `max_by` instead of `sort_by...last`, etc.
3482
+ Enabled: true
3483
+ VersionAdded: '0.76'
3484
+
3422
3485
  Style/RedundantSortBy:
3423
3486
  Description: 'Use `sort` instead of `sort_by { |x| x }`.'
3424
3487
  Enabled: true
@@ -3476,11 +3539,11 @@ Style/SafeNavigation:
3476
3539
  safe navigation (`&.`).
3477
3540
  Enabled: true
3478
3541
  VersionAdded: '0.43'
3479
- VersionChanged: '0.56'
3542
+ VersionChanged: '0.77'
3480
3543
  # Safe navigation may cause a statement to start returning `nil` in addition
3481
3544
  # to whatever it used to return.
3482
3545
  ConvertCodeThatCanStartToReturnNil: false
3483
- Whitelist:
3546
+ AllowedMethods:
3484
3547
  - present?
3485
3548
  - blank?
3486
3549
  - presence
@@ -3585,6 +3648,8 @@ Style/StringHashKeys:
3585
3648
  StyleGuide: '#symbols-as-keys'
3586
3649
  Enabled: false
3587
3650
  VersionAdded: '0.52'
3651
+ VersionChanged: '0.75'
3652
+ Safe: false
3588
3653
 
3589
3654
  Style/StringLiterals:
3590
3655
  Description: 'Checks if uses of quotes match the configured preference.'
@@ -3756,7 +3821,7 @@ Style/TrivialAccessors:
3756
3821
  StyleGuide: '#attr_family'
3757
3822
  Enabled: true
3758
3823
  VersionAdded: '0.9'
3759
- VersionChanged: '0.38'
3824
+ VersionChanged: '0.77'
3760
3825
  # When set to `false` the cop will suggest the use of accessor methods
3761
3826
  # in situations like:
3762
3827
  #
@@ -3777,7 +3842,7 @@ Style/TrivialAccessors:
3777
3842
  # Commonly used in DSLs
3778
3843
  AllowDSLWriters: false
3779
3844
  IgnoreClassMethods: false
3780
- Whitelist:
3845
+ AllowedMethod:
3781
3846
  - to_ary
3782
3847
  - to_a
3783
3848
  - to_c
@@ -3804,35 +3869,6 @@ Style/UnlessElse:
3804
3869
  Enabled: true
3805
3870
  VersionAdded: '0.9'
3806
3871
 
3807
- Style/UnneededCapitalW:
3808
- Description: 'Checks for %W when interpolation is not needed.'
3809
- Enabled: true
3810
- VersionAdded: '0.21'
3811
- VersionChanged: '0.24'
3812
-
3813
- Style/UnneededCondition:
3814
- Description: 'Checks for unnecessary conditional expressions.'
3815
- Enabled: true
3816
- VersionAdded: '0.57'
3817
-
3818
- Style/UnneededInterpolation:
3819
- Description: 'Checks for strings that are just an interpolated expression.'
3820
- Enabled: true
3821
- VersionAdded: '0.36'
3822
-
3823
- Style/UnneededPercentQ:
3824
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
3825
- StyleGuide: '#percent-q'
3826
- Enabled: true
3827
- VersionAdded: '0.24'
3828
-
3829
- Style/UnneededSort:
3830
- Description: >-
3831
- Use `min` instead of `sort.first`,
3832
- `max_by` instead of `sort_by...last`, etc.
3833
- Enabled: true
3834
- VersionAdded: '0.55'
3835
-
3836
3872
  Style/UnpackFirst:
3837
3873
  Description: >-
3838
3874
  Checks for accessing the first element of `String#unpack`
@@ -3903,8 +3939,9 @@ Style/YodaCondition:
3903
3939
  - require_for_all_comparison_operators
3904
3940
  # enforce yoda only for equality operators: `!=` and `==`
3905
3941
  - require_for_equality_operators_only
3942
+ Safe: false
3906
3943
  VersionAdded: '0.49'
3907
- VersionChanged: '0.63'
3944
+ VersionChanged: '0.75'
3908
3945
 
3909
3946
  Style/ZeroLengthPredicate:
3910
3947
  Description: 'Use #empty? when testing for objects of length 0.'