rubocop 1.9.1 → 1.22.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (560) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -14
  3. data/assets/output.html.erb +1 -1
  4. data/config/default.yml +326 -73
  5. data/config/obsoletion.yml +4 -0
  6. data/exe/rubocop +1 -3
  7. data/lib/rubocop/cached_data.rb +1 -3
  8. data/lib/rubocop/cli/command/auto_genenerate_config.rb +9 -19
  9. data/lib/rubocop/cli/command/execute_runner.rb +1 -1
  10. data/lib/rubocop/cli/command/init_dotfile.rb +1 -3
  11. data/lib/rubocop/cli/command/show_cops.rb +1 -4
  12. data/lib/rubocop/cli/command/suggest_extensions.rb +6 -5
  13. data/lib/rubocop/cli.rb +21 -5
  14. data/lib/rubocop/comment_config.rb +45 -101
  15. data/lib/rubocop/config.rb +16 -26
  16. data/lib/rubocop/config_loader.rb +11 -15
  17. data/lib/rubocop/config_loader_resolver.rb +44 -21
  18. data/lib/rubocop/config_obsoletion/cop_rule.rb +1 -2
  19. data/lib/rubocop/config_store.rb +1 -2
  20. data/lib/rubocop/config_validator.rb +37 -21
  21. data/lib/rubocop/cop/autocorrect_logic.rb +3 -8
  22. data/lib/rubocop/cop/badge.rb +1 -2
  23. data/lib/rubocop/cop/base.rb +13 -11
  24. data/lib/rubocop/cop/bundler/duplicated_gem.rb +4 -4
  25. data/lib/rubocop/cop/bundler/gem_comment.rb +43 -10
  26. data/lib/rubocop/cop/bundler/gem_filename.rb +103 -0
  27. data/lib/rubocop/cop/bundler/gem_version.rb +133 -0
  28. data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +46 -21
  29. data/lib/rubocop/cop/bundler/ordered_gems.rb +5 -16
  30. data/lib/rubocop/cop/commissioner.rb +2 -8
  31. data/lib/rubocop/cop/cop.rb +4 -18
  32. data/lib/rubocop/cop/corrector.rb +5 -8
  33. data/lib/rubocop/cop/correctors/alignment_corrector.rb +6 -12
  34. data/lib/rubocop/cop/correctors/each_to_for_corrector.rb +2 -4
  35. data/lib/rubocop/cop/correctors/for_to_each_corrector.rb +1 -2
  36. data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +2 -2
  37. data/lib/rubocop/cop/correctors/line_break_corrector.rb +3 -6
  38. data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +1 -3
  39. data/lib/rubocop/cop/correctors/ordered_gem_corrector.rb +11 -12
  40. data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +2 -8
  41. data/lib/rubocop/cop/correctors/require_library_corrector.rb +23 -0
  42. data/lib/rubocop/cop/documentation.rb +1 -1
  43. data/lib/rubocop/cop/gemspec/date_assignment.rb +57 -0
  44. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +3 -2
  45. data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +5 -16
  46. data/lib/rubocop/cop/gemspec/required_ruby_version.rb +32 -23
  47. data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +2 -0
  48. data/lib/rubocop/cop/generator/configuration_injector.rb +1 -2
  49. data/lib/rubocop/cop/generator/require_file_injector.rb +2 -5
  50. data/lib/rubocop/cop/generator.rb +18 -15
  51. data/lib/rubocop/cop/internal_affairs/example_description.rb +8 -5
  52. data/lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb +34 -0
  53. data/lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb +60 -0
  54. data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +3 -5
  55. data/lib/rubocop/cop/internal_affairs/node_destructuring.rb +3 -3
  56. data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +151 -0
  57. data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +2 -3
  58. data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +3 -2
  59. data/lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb +1 -0
  60. data/lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb +1 -0
  61. data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +1 -0
  62. data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +3 -0
  63. data/lib/rubocop/cop/internal_affairs/style_detected_api_use.rb +5 -2
  64. data/lib/rubocop/cop/internal_affairs/undefined_config.rb +71 -0
  65. data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +3 -3
  66. data/lib/rubocop/cop/internal_affairs.rb +4 -0
  67. data/lib/rubocop/cop/layout/access_modifier_indentation.rb +12 -10
  68. data/lib/rubocop/cop/layout/argument_alignment.rb +36 -19
  69. data/lib/rubocop/cop/layout/array_alignment.rb +9 -8
  70. data/lib/rubocop/cop/layout/assignment_indentation.rb +9 -8
  71. data/lib/rubocop/cop/layout/begin_end_alignment.rb +1 -4
  72. data/lib/rubocop/cop/layout/block_alignment.rb +12 -23
  73. data/lib/rubocop/cop/layout/block_end_newline.rb +4 -8
  74. data/lib/rubocop/cop/layout/case_indentation.rb +57 -11
  75. data/lib/rubocop/cop/layout/class_structure.rb +12 -12
  76. data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +24 -30
  77. data/lib/rubocop/cop/layout/comment_indentation.rb +18 -22
  78. data/lib/rubocop/cop/layout/def_end_alignment.rb +2 -6
  79. data/lib/rubocop/cop/layout/dot_position.rb +42 -9
  80. data/lib/rubocop/cop/layout/else_alignment.rb +10 -9
  81. data/lib/rubocop/cop/layout/empty_comment.rb +6 -13
  82. data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +44 -23
  83. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +2 -6
  84. data/lib/rubocop/cop/layout/empty_lines.rb +1 -3
  85. data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +8 -18
  86. data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +9 -12
  87. data/lib/rubocop/cop/layout/end_alignment.rb +10 -4
  88. data/lib/rubocop/cop/layout/end_of_line.rb +1 -1
  89. data/lib/rubocop/cop/layout/extra_spacing.rb +5 -9
  90. data/lib/rubocop/cop/layout/first_argument_indentation.rb +12 -6
  91. data/lib/rubocop/cop/layout/first_array_element_indentation.rb +13 -11
  92. data/lib/rubocop/cop/layout/first_array_element_line_break.rb +1 -2
  93. data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +37 -21
  94. data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +1 -2
  95. data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -2
  96. data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +1 -2
  97. data/lib/rubocop/cop/layout/first_parameter_indentation.rb +8 -7
  98. data/lib/rubocop/cop/layout/hash_alignment.rb +58 -31
  99. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +4 -11
  100. data/lib/rubocop/cop/layout/heredoc_indentation.rb +2 -13
  101. data/lib/rubocop/cop/layout/indentation_consistency.rb +9 -6
  102. data/lib/rubocop/cop/layout/indentation_style.rb +25 -30
  103. data/lib/rubocop/cop/layout/indentation_width.rb +34 -13
  104. data/lib/rubocop/cop/layout/initial_indentation.rb +1 -4
  105. data/lib/rubocop/cop/layout/leading_comment_space.rb +2 -2
  106. data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +141 -0
  107. data/lib/rubocop/cop/layout/line_length.rb +13 -22
  108. data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +6 -6
  109. data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +1 -2
  110. data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +29 -3
  111. data/lib/rubocop/cop/layout/multiline_block_layout.rb +10 -18
  112. data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +6 -6
  113. data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +1 -2
  114. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +4 -2
  115. data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +6 -6
  116. data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +22 -15
  117. data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +6 -6
  118. data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +13 -8
  119. data/lib/rubocop/cop/layout/parameter_alignment.rb +8 -7
  120. data/lib/rubocop/cop/layout/redundant_line_break.rb +140 -0
  121. data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +26 -16
  122. data/lib/rubocop/cop/layout/single_line_block_chain.rb +64 -0
  123. data/lib/rubocop/cop/layout/space_after_colon.rb +1 -3
  124. data/lib/rubocop/cop/layout/space_after_method_name.rb +2 -4
  125. data/lib/rubocop/cop/layout/space_after_not.rb +1 -0
  126. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +6 -14
  127. data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +2 -2
  128. data/lib/rubocop/cop/layout/space_around_keyword.rb +33 -8
  129. data/lib/rubocop/cop/layout/space_around_operators.rb +23 -11
  130. data/lib/rubocop/cop/layout/space_before_block_braces.rb +2 -3
  131. data/lib/rubocop/cop/layout/space_before_brackets.rb +3 -4
  132. data/lib/rubocop/cop/layout/space_before_comment.rb +3 -5
  133. data/lib/rubocop/cop/layout/space_before_first_arg.rb +5 -11
  134. data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +2 -4
  135. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +5 -10
  136. data/lib/rubocop/cop/layout/space_inside_array_percent_literal.rb +2 -7
  137. data/lib/rubocop/cop/layout/space_inside_block_braces.rb +6 -11
  138. data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +1 -2
  139. data/lib/rubocop/cop/layout/space_inside_parens.rb +78 -32
  140. data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +1 -2
  141. data/lib/rubocop/cop/layout/trailing_whitespace.rb +24 -1
  142. data/lib/rubocop/cop/legacy/corrections_proxy.rb +2 -8
  143. data/lib/rubocop/cop/legacy/corrector.rb +1 -3
  144. data/lib/rubocop/cop/lint/ambiguous_assignment.rb +1 -6
  145. data/lib/rubocop/cop/lint/ambiguous_block_association.rb +14 -7
  146. data/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb +111 -0
  147. data/lib/rubocop/cop/lint/ambiguous_range.rb +105 -0
  148. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +5 -2
  149. data/lib/rubocop/cop/lint/assignment_in_condition.rb +7 -5
  150. data/lib/rubocop/cop/lint/big_decimal_new.rb +1 -0
  151. data/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb +18 -5
  152. data/lib/rubocop/cop/lint/boolean_symbol.rb +7 -2
  153. data/lib/rubocop/cop/lint/constant_definition_in_block.rb +2 -0
  154. data/lib/rubocop/cop/lint/constant_resolution.rb +2 -2
  155. data/lib/rubocop/cop/lint/debugger.rb +59 -15
  156. data/lib/rubocop/cop/lint/deprecated_class_methods.rb +83 -41
  157. data/lib/rubocop/cop/lint/deprecated_constants.rb +5 -4
  158. data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +16 -9
  159. data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +24 -1
  160. data/lib/rubocop/cop/lint/duplicate_branch.rb +4 -4
  161. data/lib/rubocop/cop/lint/duplicate_hash_key.rb +1 -3
  162. data/lib/rubocop/cop/lint/duplicate_methods.rb +14 -12
  163. data/lib/rubocop/cop/lint/duplicate_require.rb +3 -2
  164. data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -0
  165. data/lib/rubocop/cop/lint/else_layout.rb +12 -10
  166. data/lib/rubocop/cop/lint/empty_block.rb +18 -2
  167. data/lib/rubocop/cop/lint/empty_ensure.rb +1 -3
  168. data/lib/rubocop/cop/lint/empty_file.rb +1 -3
  169. data/lib/rubocop/cop/lint/empty_in_pattern.rb +62 -0
  170. data/lib/rubocop/cop/lint/empty_interpolation.rb +1 -3
  171. data/lib/rubocop/cop/lint/ensure_return.rb +1 -3
  172. data/lib/rubocop/cop/lint/erb_new_arguments.rb +4 -7
  173. data/lib/rubocop/cop/lint/float_out_of_range.rb +1 -2
  174. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +4 -6
  175. data/lib/rubocop/cop/lint/hash_compare_by_identity.rb +13 -3
  176. data/lib/rubocop/cop/lint/heredoc_method_call_position.rb +1 -2
  177. data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +1 -2
  178. data/lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb +67 -0
  179. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +4 -7
  180. data/lib/rubocop/cop/lint/inherit_exception.rb +2 -2
  181. data/lib/rubocop/cop/lint/interpolation_check.rb +8 -11
  182. data/lib/rubocop/cop/lint/literal_as_condition.rb +13 -1
  183. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +3 -6
  184. data/lib/rubocop/cop/lint/loop.rb +5 -5
  185. data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +32 -21
  186. data/lib/rubocop/cop/lint/missing_super.rb +1 -2
  187. data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +1 -2
  188. data/lib/rubocop/cop/lint/multiple_comparison.rb +5 -4
  189. data/lib/rubocop/cop/lint/nested_method_definition.rb +4 -2
  190. data/lib/rubocop/cop/lint/nested_percent_literal.rb +2 -4
  191. data/lib/rubocop/cop/lint/next_without_accumulator.rb +1 -0
  192. data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +13 -4
  193. data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +3 -0
  194. data/lib/rubocop/cop/lint/number_conversion.rb +25 -6
  195. data/lib/rubocop/cop/lint/numbered_parameter_assignment.rb +1 -1
  196. data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +4 -2
  197. data/lib/rubocop/cop/lint/ordered_magic_comments.rb +1 -2
  198. data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +18 -3
  199. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +1 -3
  200. data/lib/rubocop/cop/lint/percent_string_array.rb +11 -1
  201. data/lib/rubocop/cop/lint/percent_symbol_array.rb +2 -4
  202. data/lib/rubocop/cop/lint/raise_exception.rb +7 -2
  203. data/lib/rubocop/cop/lint/rand_one.rb +2 -2
  204. data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +108 -90
  205. data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +5 -0
  206. data/lib/rubocop/cop/lint/redundant_require_statement.rb +1 -0
  207. data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +7 -7
  208. data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +10 -10
  209. data/lib/rubocop/cop/lint/redundant_string_coercion.rb +2 -2
  210. data/lib/rubocop/cop/lint/redundant_with_index.rb +2 -4
  211. data/lib/rubocop/cop/lint/redundant_with_object.rb +2 -4
  212. data/lib/rubocop/cop/lint/regexp_as_condition.rb +1 -3
  213. data/lib/rubocop/cop/lint/require_parentheses.rb +2 -4
  214. data/lib/rubocop/cop/lint/require_relative_self_path.rb +50 -0
  215. data/lib/rubocop/cop/lint/rescue_exception.rb +1 -2
  216. data/lib/rubocop/cop/lint/rescue_type.rb +2 -7
  217. data/lib/rubocop/cop/lint/return_in_void_context.rb +1 -2
  218. data/lib/rubocop/cop/lint/safe_navigation_chain.rb +2 -2
  219. data/lib/rubocop/cop/lint/safe_navigation_consistency.rb +4 -10
  220. data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +2 -2
  221. data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +3 -7
  222. data/lib/rubocop/cop/lint/shadowed_argument.rb +6 -12
  223. data/lib/rubocop/cop/lint/shadowed_exception.rb +7 -8
  224. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +2 -1
  225. data/lib/rubocop/cop/lint/struct_new_override.rb +2 -2
  226. data/lib/rubocop/cop/lint/suppressed_exception.rb +44 -1
  227. data/lib/rubocop/cop/lint/symbol_conversion.rb +86 -11
  228. data/lib/rubocop/cop/lint/syntax.rb +1 -3
  229. data/lib/rubocop/cop/lint/to_enum_arguments.rb +3 -0
  230. data/lib/rubocop/cop/lint/to_json.rb +1 -2
  231. data/lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb +1 -3
  232. data/lib/rubocop/cop/lint/triple_quotes.rb +1 -1
  233. data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +1 -3
  234. data/lib/rubocop/cop/lint/unexpected_block_arity.rb +8 -3
  235. data/lib/rubocop/cop/lint/unified_integer.rb +1 -0
  236. data/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb +5 -0
  237. data/lib/rubocop/cop/lint/unreachable_code.rb +3 -5
  238. data/lib/rubocop/cop/lint/unreachable_loop.rb +15 -7
  239. data/lib/rubocop/cop/lint/unused_block_argument.rb +10 -8
  240. data/lib/rubocop/cop/lint/unused_method_argument.rb +4 -5
  241. data/lib/rubocop/cop/lint/uri_escape_unescape.rb +1 -0
  242. data/lib/rubocop/cop/lint/useless_access_modifier.rb +6 -4
  243. data/lib/rubocop/cop/lint/useless_assignment.rb +5 -10
  244. data/lib/rubocop/cop/lint/useless_method_definition.rb +3 -2
  245. data/lib/rubocop/cop/lint/useless_setter_call.rb +9 -7
  246. data/lib/rubocop/cop/lint/useless_times.rb +8 -4
  247. data/lib/rubocop/cop/lint/void.rb +5 -12
  248. data/lib/rubocop/cop/message_annotator.rb +1 -3
  249. data/lib/rubocop/cop/metrics/abc_size.rb +6 -0
  250. data/lib/rubocop/cop/metrics/block_nesting.rb +2 -7
  251. data/lib/rubocop/cop/metrics/class_length.rb +1 -3
  252. data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +1 -2
  253. data/lib/rubocop/cop/metrics/module_length.rb +3 -6
  254. data/lib/rubocop/cop/metrics/parameter_lists.rb +8 -7
  255. data/lib/rubocop/cop/metrics/perceived_complexity.rb +2 -3
  256. data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +5 -8
  257. data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +8 -6
  258. data/lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb +4 -7
  259. data/lib/rubocop/cop/migration/department_name.rb +4 -6
  260. data/lib/rubocop/cop/mixin/alignment.rb +12 -7
  261. data/lib/rubocop/cop/mixin/annotation_comment.rb +57 -34
  262. data/lib/rubocop/cop/mixin/check_line_breakable.rb +29 -4
  263. data/lib/rubocop/cop/mixin/code_length.rb +2 -4
  264. data/lib/rubocop/cop/mixin/comments_help.rb +5 -1
  265. data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +2 -2
  266. data/lib/rubocop/cop/mixin/configurable_formatting.rb +3 -8
  267. data/lib/rubocop/cop/mixin/def_node.rb +3 -5
  268. data/lib/rubocop/cop/mixin/documentation_comment.rb +8 -8
  269. data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +6 -7
  270. data/lib/rubocop/cop/mixin/empty_parameter.rb +2 -3
  271. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +2 -5
  272. data/lib/rubocop/cop/mixin/enforce_superclass.rb +4 -6
  273. data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -3
  274. data/lib/rubocop/cop/mixin/frozen_string_literal.rb +30 -8
  275. data/lib/rubocop/cop/mixin/gem_declaration.rb +13 -0
  276. data/lib/rubocop/cop/mixin/hash_alignment_styles.rb +17 -9
  277. data/lib/rubocop/cop/mixin/hash_transform_method.rb +16 -25
  278. data/lib/rubocop/cop/mixin/heredoc.rb +5 -0
  279. data/lib/rubocop/cop/mixin/interpolation.rb +1 -3
  280. data/lib/rubocop/cop/mixin/line_length_help.rb +13 -10
  281. data/lib/rubocop/cop/mixin/match_range.rb +2 -5
  282. data/lib/rubocop/cop/mixin/method_complexity.rb +2 -3
  283. data/lib/rubocop/cop/mixin/method_preference.rb +1 -2
  284. data/lib/rubocop/cop/mixin/multiline_element_indentation.rb +5 -4
  285. data/lib/rubocop/cop/mixin/multiline_element_line_breaks.rb +1 -3
  286. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +13 -42
  287. data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +2 -3
  288. data/lib/rubocop/cop/mixin/negative_conditional.rb +4 -2
  289. data/lib/rubocop/cop/mixin/ordered_gem_node.rb +10 -5
  290. data/lib/rubocop/cop/mixin/percent_array.rb +17 -8
  291. data/lib/rubocop/cop/mixin/percent_literal.rb +0 -6
  292. data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +14 -12
  293. data/lib/rubocop/cop/mixin/preferred_delimiters.rb +6 -9
  294. data/lib/rubocop/cop/mixin/range_help.rb +10 -13
  295. data/lib/rubocop/cop/mixin/rational_literal.rb +1 -0
  296. data/lib/rubocop/cop/mixin/require_library.rb +59 -0
  297. data/lib/rubocop/cop/mixin/rescue_node.rb +2 -6
  298. data/lib/rubocop/cop/mixin/safe_assignment.rb +6 -2
  299. data/lib/rubocop/cop/mixin/space_after_punctuation.rb +2 -4
  300. data/lib/rubocop/cop/mixin/space_before_punctuation.rb +3 -4
  301. data/lib/rubocop/cop/mixin/statement_modifier.rb +2 -4
  302. data/lib/rubocop/cop/mixin/string_literals_help.rb +7 -5
  303. data/lib/rubocop/cop/mixin/symbol_help.rb +13 -0
  304. data/lib/rubocop/cop/mixin/trailing_body.rb +2 -3
  305. data/lib/rubocop/cop/mixin/trailing_comma.rb +1 -2
  306. data/lib/rubocop/cop/mixin/uncommunicative_name.rb +7 -13
  307. data/lib/rubocop/cop/mixin/unused_argument.rb +1 -3
  308. data/lib/rubocop/cop/mixin/visibility_help.rb +1 -0
  309. data/lib/rubocop/cop/naming/ascii_identifiers.rb +2 -7
  310. data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +2 -2
  311. data/lib/rubocop/cop/naming/block_parameter_name.rb +1 -1
  312. data/lib/rubocop/cop/naming/constant_name.rb +3 -1
  313. data/lib/rubocop/cop/naming/file_name.rb +7 -16
  314. data/lib/rubocop/cop/naming/inclusive_language.rb +266 -0
  315. data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +11 -5
  316. data/lib/rubocop/cop/naming/method_name.rb +4 -2
  317. data/lib/rubocop/cop/naming/predicate_name.rb +2 -2
  318. data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +17 -0
  319. data/lib/rubocop/cop/offense.rb +3 -8
  320. data/lib/rubocop/cop/registry.rb +13 -12
  321. data/lib/rubocop/cop/security/eval.rb +1 -0
  322. data/lib/rubocop/cop/security/io_methods.rb +49 -0
  323. data/lib/rubocop/cop/security/json_load.rb +9 -7
  324. data/lib/rubocop/cop/security/marshal_load.rb +1 -0
  325. data/lib/rubocop/cop/security/open.rb +5 -0
  326. data/lib/rubocop/cop/security/yaml_load.rb +5 -0
  327. data/lib/rubocop/cop/style/access_modifier_declarations.rb +4 -5
  328. data/lib/rubocop/cop/style/accessor_grouping.rb +3 -5
  329. data/lib/rubocop/cop/style/alias.rb +6 -12
  330. data/lib/rubocop/cop/style/and_or.rb +8 -1
  331. data/lib/rubocop/cop/style/arguments_forwarding.rb +17 -5
  332. data/lib/rubocop/cop/style/array_coercion.rb +23 -3
  333. data/lib/rubocop/cop/style/array_join.rb +1 -0
  334. data/lib/rubocop/cop/style/ascii_comments.rb +1 -5
  335. data/lib/rubocop/cop/style/attr.rb +2 -3
  336. data/lib/rubocop/cop/style/auto_resource_cleanup.rb +2 -5
  337. data/lib/rubocop/cop/style/bisected_attr_accessor/macro.rb +60 -0
  338. data/lib/rubocop/cop/style/bisected_attr_accessor.rb +59 -71
  339. data/lib/rubocop/cop/style/block_delimiters.rb +50 -2
  340. data/lib/rubocop/cop/style/case_equality.rb +8 -10
  341. data/lib/rubocop/cop/style/case_like_if.rb +21 -6
  342. data/lib/rubocop/cop/style/character_literal.rb +2 -4
  343. data/lib/rubocop/cop/style/class_and_module_children.rb +42 -10
  344. data/lib/rubocop/cop/style/class_equality_comparison.rb +3 -0
  345. data/lib/rubocop/cop/style/class_methods.rb +1 -3
  346. data/lib/rubocop/cop/style/collection_compact.rb +10 -8
  347. data/lib/rubocop/cop/style/collection_methods.rb +8 -6
  348. data/lib/rubocop/cop/style/colon_method_call.rb +2 -3
  349. data/lib/rubocop/cop/style/combinable_loops.rb +6 -4
  350. data/lib/rubocop/cop/style/command_literal.rb +4 -9
  351. data/lib/rubocop/cop/style/comment_annotation.rb +57 -30
  352. data/lib/rubocop/cop/style/commented_keyword.rb +16 -16
  353. data/lib/rubocop/cop/style/conditional_assignment.rb +31 -29
  354. data/lib/rubocop/cop/style/constant_visibility.rb +28 -0
  355. data/lib/rubocop/cop/style/copyright.rb +3 -6
  356. data/lib/rubocop/cop/style/date_time.rb +10 -5
  357. data/lib/rubocop/cop/style/def_with_parentheses.rb +1 -2
  358. data/lib/rubocop/cop/style/dir.rb +1 -0
  359. data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +2 -2
  360. data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +1 -1
  361. data/lib/rubocop/cop/style/documentation.rb +52 -10
  362. data/lib/rubocop/cop/style/documentation_method.rb +1 -0
  363. data/lib/rubocop/cop/style/double_cop_disable_directive.rb +1 -7
  364. data/lib/rubocop/cop/style/double_negation.rb +30 -8
  365. data/lib/rubocop/cop/style/each_for_simple_loop.rb +2 -2
  366. data/lib/rubocop/cop/style/each_with_object.rb +1 -0
  367. data/lib/rubocop/cop/style/empty_case_condition.rb +2 -7
  368. data/lib/rubocop/cop/style/empty_else.rb +3 -9
  369. data/lib/rubocop/cop/style/empty_literal.rb +21 -9
  370. data/lib/rubocop/cop/style/empty_method.rb +3 -7
  371. data/lib/rubocop/cop/style/encoding.rb +26 -15
  372. data/lib/rubocop/cop/style/end_block.rb +1 -2
  373. data/lib/rubocop/cop/style/endless_method.rb +2 -3
  374. data/lib/rubocop/cop/style/eval_with_location.rb +91 -31
  375. data/lib/rubocop/cop/style/even_odd.rb +1 -0
  376. data/lib/rubocop/cop/style/expand_path_arguments.rb +4 -3
  377. data/lib/rubocop/cop/style/explicit_block_argument.rb +48 -15
  378. data/lib/rubocop/cop/style/exponential_notation.rb +6 -7
  379. data/lib/rubocop/cop/style/float_division.rb +14 -2
  380. data/lib/rubocop/cop/style/format_string.rb +2 -0
  381. data/lib/rubocop/cop/style/format_string_token.rb +2 -4
  382. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +15 -12
  383. data/lib/rubocop/cop/style/global_std_stream.rb +5 -0
  384. data/lib/rubocop/cop/style/guard_clause.rb +3 -7
  385. data/lib/rubocop/cop/style/hash_as_last_array_item.rb +11 -0
  386. data/lib/rubocop/cop/style/hash_conversion.rb +133 -0
  387. data/lib/rubocop/cop/style/hash_each_methods.rb +25 -3
  388. data/lib/rubocop/cop/style/hash_except.rb +5 -3
  389. data/lib/rubocop/cop/style/hash_like_case.rb +2 -2
  390. data/lib/rubocop/cop/style/hash_syntax.rb +21 -25
  391. data/lib/rubocop/cop/style/hash_transform_keys.rb +8 -9
  392. data/lib/rubocop/cop/style/hash_transform_values.rb +8 -6
  393. data/lib/rubocop/cop/style/identical_conditional_branches.rb +83 -8
  394. data/lib/rubocop/cop/style/if_unless_modifier.rb +40 -13
  395. data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +20 -4
  396. data/lib/rubocop/cop/style/implicit_runtime_error.rb +1 -0
  397. data/lib/rubocop/cop/style/in_pattern_then.rb +56 -0
  398. data/lib/rubocop/cop/style/infinite_loop.rb +6 -8
  399. data/lib/rubocop/cop/style/inverse_methods.rb +14 -9
  400. data/lib/rubocop/cop/style/ip_addresses.rb +1 -2
  401. data/lib/rubocop/cop/style/lambda.rb +2 -4
  402. data/lib/rubocop/cop/style/lambda_call.rb +1 -2
  403. data/lib/rubocop/cop/style/line_end_concatenation.rb +19 -13
  404. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +32 -21
  405. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +47 -3
  406. data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +1 -2
  407. data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +2 -4
  408. data/lib/rubocop/cop/style/method_def_parentheses.rb +14 -9
  409. data/lib/rubocop/cop/style/min_max.rb +2 -2
  410. data/lib/rubocop/cop/style/missing_else.rb +9 -4
  411. data/lib/rubocop/cop/style/missing_respond_to_missing.rb +1 -2
  412. data/lib/rubocop/cop/style/mixin_grouping.rb +4 -10
  413. data/lib/rubocop/cop/style/mixin_usage.rb +3 -2
  414. data/lib/rubocop/cop/style/module_function.rb +16 -15
  415. data/lib/rubocop/cop/style/multiline_block_chain.rb +1 -2
  416. data/lib/rubocop/cop/style/multiline_in_pattern_then.rb +62 -0
  417. data/lib/rubocop/cop/style/multiline_method_signature.rb +11 -6
  418. data/lib/rubocop/cop/style/multiline_ternary_operator.rb +1 -2
  419. data/lib/rubocop/cop/style/multiline_when_then.rb +3 -12
  420. data/lib/rubocop/cop/style/multiple_comparison.rb +23 -6
  421. data/lib/rubocop/cop/style/mutable_constant.rb +85 -23
  422. data/lib/rubocop/cop/style/negated_if.rb +1 -2
  423. data/lib/rubocop/cop/style/negated_if_else_condition.rb +24 -2
  424. data/lib/rubocop/cop/style/negated_unless.rb +1 -2
  425. data/lib/rubocop/cop/style/nested_modifier.rb +3 -7
  426. data/lib/rubocop/cop/style/nested_ternary_operator.rb +2 -3
  427. data/lib/rubocop/cop/style/next.rb +4 -9
  428. data/lib/rubocop/cop/style/nil_comparison.rb +3 -0
  429. data/lib/rubocop/cop/style/nil_lambda.rb +30 -12
  430. data/lib/rubocop/cop/style/non_nil_check.rb +11 -7
  431. data/lib/rubocop/cop/style/not.rb +2 -2
  432. data/lib/rubocop/cop/style/numbered_parameters.rb +46 -0
  433. data/lib/rubocop/cop/style/numbered_parameters_limit.rb +50 -0
  434. data/lib/rubocop/cop/style/numeric_literals.rb +6 -15
  435. data/lib/rubocop/cop/style/numeric_predicate.rb +10 -7
  436. data/lib/rubocop/cop/style/one_line_conditional.rb +1 -2
  437. data/lib/rubocop/cop/style/option_hash.rb +2 -3
  438. data/lib/rubocop/cop/style/optional_arguments.rb +6 -5
  439. data/lib/rubocop/cop/style/optional_boolean_parameter.rb +14 -4
  440. data/lib/rubocop/cop/style/or_assignment.rb +4 -6
  441. data/lib/rubocop/cop/style/parallel_assignment.rb +13 -10
  442. data/lib/rubocop/cop/style/parentheses_around_condition.rb +1 -0
  443. data/lib/rubocop/cop/style/percent_literal_delimiters.rb +2 -4
  444. data/lib/rubocop/cop/style/percent_q_literals.rb +3 -4
  445. data/lib/rubocop/cop/style/perl_backrefs.rb +2 -9
  446. data/lib/rubocop/cop/style/preferred_hash_methods.rb +10 -8
  447. data/lib/rubocop/cop/style/proc.rb +2 -2
  448. data/lib/rubocop/cop/style/quoted_symbols.rb +114 -0
  449. data/lib/rubocop/cop/style/raise_args.rb +6 -8
  450. data/lib/rubocop/cop/style/random_with_offset.rb +8 -8
  451. data/lib/rubocop/cop/style/redundant_argument.rb +21 -20
  452. data/lib/rubocop/cop/style/redundant_assignment.rb +2 -3
  453. data/lib/rubocop/cop/style/redundant_begin.rb +72 -7
  454. data/lib/rubocop/cop/style/redundant_capital_w.rb +1 -2
  455. data/lib/rubocop/cop/style/redundant_condition.rb +4 -8
  456. data/lib/rubocop/cop/style/redundant_conditional.rb +5 -6
  457. data/lib/rubocop/cop/style/redundant_exception.rb +5 -6
  458. data/lib/rubocop/cop/style/redundant_fetch_block.rb +6 -0
  459. data/lib/rubocop/cop/style/redundant_file_extension_in_require.rb +13 -3
  460. data/lib/rubocop/cop/style/redundant_freeze.rb +6 -6
  461. data/lib/rubocop/cop/style/redundant_interpolation.rb +2 -3
  462. data/lib/rubocop/cop/style/redundant_parentheses.rb +21 -20
  463. data/lib/rubocop/cop/style/redundant_percent_q.rb +3 -5
  464. data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +1 -1
  465. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +1 -4
  466. data/lib/rubocop/cop/style/redundant_return.rb +6 -4
  467. data/lib/rubocop/cop/style/redundant_self.rb +42 -10
  468. data/lib/rubocop/cop/style/redundant_self_assignment.rb +8 -5
  469. data/lib/rubocop/cop/style/redundant_self_assignment_branch.rb +83 -0
  470. data/lib/rubocop/cop/style/redundant_sort.rb +56 -25
  471. data/lib/rubocop/cop/style/redundant_sort_by.rb +1 -0
  472. data/lib/rubocop/cop/style/regexp_literal.rb +15 -10
  473. data/lib/rubocop/cop/style/rescue_modifier.rb +21 -14
  474. data/lib/rubocop/cop/style/rescue_standard_error.rb +5 -7
  475. data/lib/rubocop/cop/style/return_nil.rb +8 -2
  476. data/lib/rubocop/cop/style/safe_navigation.rb +25 -23
  477. data/lib/rubocop/cop/style/sample.rb +1 -0
  478. data/lib/rubocop/cop/style/select_by_regexp.rb +139 -0
  479. data/lib/rubocop/cop/style/semicolon.rb +32 -24
  480. data/lib/rubocop/cop/style/send.rb +1 -2
  481. data/lib/rubocop/cop/style/signal_exception.rb +6 -7
  482. data/lib/rubocop/cop/style/single_argument_dig.rb +7 -2
  483. data/lib/rubocop/cop/style/single_line_block_params.rb +5 -6
  484. data/lib/rubocop/cop/style/single_line_methods.rb +45 -18
  485. data/lib/rubocop/cop/style/slicing_with_range.rb +14 -0
  486. data/lib/rubocop/cop/style/sole_nested_conditional.rb +35 -7
  487. data/lib/rubocop/cop/style/special_global_vars.rb +33 -20
  488. data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +1 -2
  489. data/lib/rubocop/cop/style/static_class.rb +5 -5
  490. data/lib/rubocop/cop/style/stderr_puts.rb +3 -6
  491. data/lib/rubocop/cop/style/string_chars.rb +41 -0
  492. data/lib/rubocop/cop/style/string_concatenation.rb +45 -15
  493. data/lib/rubocop/cop/style/string_hash_keys.rb +6 -0
  494. data/lib/rubocop/cop/style/string_literals.rb +5 -7
  495. data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +1 -0
  496. data/lib/rubocop/cop/style/strip.rb +1 -0
  497. data/lib/rubocop/cop/style/struct_inheritance.rb +15 -0
  498. data/lib/rubocop/cop/style/swap_values.rb +5 -3
  499. data/lib/rubocop/cop/style/symbol_array.rb +3 -3
  500. data/lib/rubocop/cop/style/symbol_literal.rb +1 -3
  501. data/lib/rubocop/cop/style/symbol_proc.rb +55 -10
  502. data/lib/rubocop/cop/style/ternary_parentheses.rb +4 -6
  503. data/lib/rubocop/cop/style/top_level_method_definition.rb +83 -0
  504. data/lib/rubocop/cop/style/trailing_body_on_method_definition.rb +6 -2
  505. data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +21 -6
  506. data/lib/rubocop/cop/style/trailing_method_end_statement.rb +3 -6
  507. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +4 -10
  508. data/lib/rubocop/cop/style/trivial_accessors.rb +69 -5
  509. data/lib/rubocop/cop/style/unless_else.rb +1 -2
  510. data/lib/rubocop/cop/style/unless_logical_operators.rb +105 -0
  511. data/lib/rubocop/cop/style/unpack_first.rb +2 -1
  512. data/lib/rubocop/cop/style/variable_interpolation.rb +1 -1
  513. data/lib/rubocop/cop/style/when_then.rb +4 -2
  514. data/lib/rubocop/cop/style/while_until_modifier.rb +1 -2
  515. data/lib/rubocop/cop/style/word_array.rb +22 -5
  516. data/lib/rubocop/cop/style/yoda_condition.rb +28 -18
  517. data/lib/rubocop/cop/style/zero_length_predicate.rb +12 -2
  518. data/lib/rubocop/cop/team.rb +2 -5
  519. data/lib/rubocop/cop/util.rb +29 -16
  520. data/lib/rubocop/cop/utils/format_string.rb +1 -3
  521. data/lib/rubocop/cop/variable_force/assignment.rb +1 -2
  522. data/lib/rubocop/cop/variable_force/branch.rb +16 -2
  523. data/lib/rubocop/cop/variable_force/reference.rb +1 -3
  524. data/lib/rubocop/cop/variable_force/scope.rb +4 -8
  525. data/lib/rubocop/cop/variable_force/variable.rb +2 -4
  526. data/lib/rubocop/cop/variable_force/variable_table.rb +1 -1
  527. data/lib/rubocop/cop/variable_force.rb +6 -15
  528. data/lib/rubocop/cops_documentation_generator.rb +24 -26
  529. data/lib/rubocop/directive_comment.rb +123 -11
  530. data/lib/rubocop/ext/regexp_parser.rb +3 -6
  531. data/lib/rubocop/file_finder.rb +1 -3
  532. data/lib/rubocop/formatter/clang_style_formatter.rb +4 -2
  533. data/lib/rubocop/formatter/disabled_config_formatter.rb +3 -8
  534. data/lib/rubocop/formatter/git_hub_actions_formatter.rb +2 -6
  535. data/lib/rubocop/formatter/html_formatter.rb +4 -10
  536. data/lib/rubocop/formatter/json_formatter.rb +1 -5
  537. data/lib/rubocop/formatter/junit_formatter.rb +23 -14
  538. data/lib/rubocop/formatter/offense_count_formatter.rb +1 -1
  539. data/lib/rubocop/formatter/progress_formatter.rb +1 -3
  540. data/lib/rubocop/formatter/tap_formatter.rb +4 -2
  541. data/lib/rubocop/formatter/worst_offenders_formatter.rb +1 -1
  542. data/lib/rubocop/magic_comment.rb +45 -16
  543. data/lib/rubocop/name_similarity.rb +1 -1
  544. data/lib/rubocop/options.rb +153 -159
  545. data/lib/rubocop/path_util.rb +1 -3
  546. data/lib/rubocop/rake_task.rb +4 -1
  547. data/lib/rubocop/remote_config.rb +13 -8
  548. data/lib/rubocop/result_cache.rb +8 -15
  549. data/lib/rubocop/rspec/cop_helper.rb +3 -3
  550. data/lib/rubocop/rspec/expect_offense.rb +11 -12
  551. data/lib/rubocop/rspec/parallel_formatter.rb +90 -0
  552. data/lib/rubocop/rspec/shared_contexts.rb +8 -15
  553. data/lib/rubocop/rspec/support.rb +1 -0
  554. data/lib/rubocop/runner.rb +9 -17
  555. data/lib/rubocop/target_finder.rb +20 -17
  556. data/lib/rubocop/target_ruby.rb +25 -21
  557. data/lib/rubocop/version.rb +1 -1
  558. data/lib/rubocop.rb +30 -3
  559. metadata +44 -11
  560. data/lib/rubocop/core_ext/hash.rb +0 -20
data/config/default.yml CHANGED
@@ -130,7 +130,7 @@ AllCops:
130
130
  # What MRI version of the Ruby interpreter is the inspected code intended to
131
131
  # run on? (If there is more than one, set this to the lowest version.)
132
132
  # If a value is specified for TargetRubyVersion then it is used. Acceptable
133
- # values are specificed as a float (i.e. 2.5); the teeny version of Ruby
133
+ # values are specified as a float (i.e. 3.0); the teeny version of Ruby
134
134
  # should not be included. If the project specifies a Ruby version in the
135
135
  # .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
136
136
  # try to determine the desired version of Ruby by inspecting the
@@ -138,7 +138,7 @@ AllCops:
138
138
  # or gems.locked file. (Although the Ruby version is specified in the Gemfile
139
139
  # or gems.rb file, RuboCop reads the final value from the lock file.) If the
140
140
  # Ruby version is still unresolved, RuboCop will use the oldest officially
141
- # supported Ruby version (currently Ruby 2.4).
141
+ # supported Ruby version (currently Ruby 2.5).
142
142
  TargetRubyVersion: ~
143
143
  # Determines if a notification for extension libraries should be shown when
144
144
  # rubocop is run. Keys are the name of the extension, and values are an array
@@ -174,6 +174,34 @@ Bundler/GemComment:
174
174
  IgnoredGems: []
175
175
  OnlyFor: []
176
176
 
177
+ Bundler/GemFilename:
178
+ Description: 'Enforces the filename for managing gems.'
179
+ Enabled: true
180
+ VersionAdded: '1.20'
181
+ EnforcedStyle: 'Gemfile'
182
+ SupportedStyles:
183
+ - 'Gemfile'
184
+ - 'gems.rb'
185
+ Include:
186
+ - '**/Gemfile'
187
+ - '**/gems.rb'
188
+ - '**/Gemfile.lock'
189
+ - '**/gems.locked'
190
+
191
+ Bundler/GemVersion:
192
+ Description: 'Requires or forbids specifying gem versions.'
193
+ Enabled: false
194
+ VersionAdded: '1.14'
195
+ EnforcedStyle: 'required'
196
+ SupportedStyles:
197
+ - 'required'
198
+ - 'forbidden'
199
+ Include:
200
+ - '**/*.gemfile'
201
+ - '**/Gemfile'
202
+ - '**/gems.rb'
203
+ AllowedGems: []
204
+
177
205
  Bundler/InsecureProtocolSource:
178
206
  Description: >-
179
207
  The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
@@ -181,6 +209,7 @@ Bundler/InsecureProtocolSource:
181
209
  'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
182
210
  Enabled: true
183
211
  VersionAdded: '0.50'
212
+ AllowHttpProtocol: true
184
213
  Include:
185
214
  - '**/*.gemfile'
186
215
  - '**/Gemfile'
@@ -203,6 +232,13 @@ Bundler/OrderedGems:
203
232
 
204
233
  #################### Gemspec ###############################
205
234
 
235
+ Gemspec/DateAssignment:
236
+ Description: 'Checks that `date =` is not used in gemspec file, it is set automatically when the gem is packaged.'
237
+ Enabled: pending
238
+ VersionAdded: '1.10'
239
+ Include:
240
+ - '**/*.gemspec'
241
+
206
242
  Gemspec/DuplicatedAssignment:
207
243
  Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
208
244
  Enabled: true
@@ -226,7 +262,7 @@ Gemspec/RequiredRubyVersion:
226
262
  Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
227
263
  Enabled: true
228
264
  VersionAdded: '0.52'
229
- VersionChanged: '0.89'
265
+ VersionChanged: '1.22'
230
266
  Include:
231
267
  - '**/*.gemspec'
232
268
 
@@ -249,8 +285,8 @@ Layout/AccessModifierIndentation:
249
285
  SupportedStyles:
250
286
  - outdent
251
287
  - indent
252
- # By default, the indentation width from Layout/IndentationWidth is used
253
- # But it can be overridden by setting this parameter
288
+ # By default the indentation width from `Layout/IndentationWidth` is used,
289
+ # but it can be overridden by setting this parameter.
254
290
  IndentationWidth: ~
255
291
 
256
292
  Layout/ArgumentAlignment:
@@ -278,8 +314,8 @@ Layout/ArgumentAlignment:
278
314
  SupportedStyles:
279
315
  - with_first_argument
280
316
  - with_fixed_indentation
281
- # By default, the indentation width from Layout/IndentationWidth is used
282
- # But it can be overridden by setting this parameter
317
+ # By default the indentation width from `Layout/IndentationWidth` is used,
318
+ # but it can be overridden by setting this parameter.
283
319
  IndentationWidth: ~
284
320
 
285
321
  Layout/ArrayAlignment:
@@ -307,8 +343,8 @@ Layout/ArrayAlignment:
307
343
  SupportedStyles:
308
344
  - with_first_element
309
345
  - with_fixed_indentation
310
- # By default, the indentation width from Layout/IndentationWidth is used
311
- # But it can be overridden by setting this parameter
346
+ # By default the indentation width from `Layout/IndentationWidth` is used,
347
+ # but it can be overridden by setting this parameter.
312
348
  IndentationWidth: ~
313
349
 
314
350
  Layout/AssignmentIndentation:
@@ -318,8 +354,8 @@ Layout/AssignmentIndentation:
318
354
  Enabled: true
319
355
  VersionAdded: '0.49'
320
356
  VersionChanged: '0.77'
321
- # By default, the indentation width from `Layout/IndentationWidth` is used
322
- # But it can be overridden by setting this parameter
357
+ # By default the indentation width from `Layout/IndentationWidth` is used,
358
+ # but it can be overridden by setting this parameter.
323
359
  IndentationWidth: ~
324
360
 
325
361
  Layout/BeginEndAlignment:
@@ -356,18 +392,19 @@ Layout/BlockEndNewline:
356
392
  VersionAdded: '0.49'
357
393
 
358
394
  Layout/CaseIndentation:
359
- Description: 'Indentation of when in a case/when/[else/]end.'
395
+ Description: 'Indentation of when in a case/(when|in)/[else/]end.'
360
396
  StyleGuide: '#indent-when-to-case'
361
397
  Enabled: true
362
398
  VersionAdded: '0.49'
399
+ VersionChanged: '1.16'
363
400
  EnforcedStyle: case
364
401
  SupportedStyles:
365
402
  - case
366
403
  - end
367
404
  IndentOneStep: false
368
- # By default, the indentation width from `Layout/IndentationWidth` is used.
369
- # But it can be overridden by setting this parameter.
370
- # This only matters if `IndentOneStep` is `true`
405
+ # By default the indentation width from `Layout/IndentationWidth` is used,
406
+ # but it can be overridden by setting this parameter.
407
+ # This only matters if `IndentOneStep` is `true`.
371
408
  IndentationWidth: ~
372
409
 
373
410
  Layout/ClassStructure:
@@ -644,8 +681,8 @@ Layout/FirstArgumentIndentation:
644
681
  # Same as `special_for_inner_method_call` except that the special rule only
645
682
  # applies if the outer method call encloses its arguments in parentheses.
646
683
  - special_for_inner_method_call_in_parentheses
647
- # By default, the indentation width from `Layout/IndentationWidth` is used
648
- # But it can be overridden by setting this parameter
684
+ # By default the indentation width from `Layout/IndentationWidth` is used,
685
+ # but it can be overridden by setting this parameter.
649
686
  IndentationWidth: ~
650
687
 
651
688
  Layout/FirstArrayElementIndentation:
@@ -671,8 +708,8 @@ Layout/FirstArrayElementIndentation:
671
708
  - special_inside_parentheses
672
709
  - consistent
673
710
  - align_brackets
674
- # By default, the indentation width from `Layout/IndentationWidth` is used
675
- # But it can be overridden by setting this parameter
711
+ # By default the indentation width from `Layout/IndentationWidth` is used,
712
+ # but it can be overridden by setting this parameter.
676
713
  IndentationWidth: ~
677
714
 
678
715
  Layout/FirstArrayElementLineBreak:
@@ -703,8 +740,8 @@ Layout/FirstHashElementIndentation:
703
740
  - special_inside_parentheses
704
741
  - consistent
705
742
  - align_braces
706
- # By default, the indentation width from `Layout/IndentationWidth` is used
707
- # But it can be overridden by setting this parameter
743
+ # By default the indentation width from `Layout/IndentationWidth` is used,
744
+ # but it can be overridden by setting this parameter.
708
745
  IndentationWidth: ~
709
746
 
710
747
  Layout/FirstHashElementLineBreak:
@@ -739,8 +776,8 @@ Layout/FirstParameterIndentation:
739
776
  SupportedStyles:
740
777
  - consistent
741
778
  - align_parentheses
742
- # By default, the indentation width from `Layout/IndentationWidth` is used
743
- # But it can be overridden by setting this parameter
779
+ # By default the indentation width from `Layout/IndentationWidth` is used,
780
+ # but it can be overridden by setting this parameter.
744
781
  IndentationWidth: ~
745
782
 
746
783
  Layout/HashAlignment:
@@ -750,7 +787,7 @@ Layout/HashAlignment:
750
787
  Enabled: true
751
788
  AllowMultipleStyles: true
752
789
  VersionAdded: '0.49'
753
- VersionChanged: '0.77'
790
+ VersionChanged: '1.16'
754
791
  # Alignment of entries using hash rocket as separator. Valid values are:
755
792
  #
756
793
  # key - left alignment of keys
@@ -861,8 +898,8 @@ Layout/IndentationStyle:
861
898
  Enabled: true
862
899
  VersionAdded: '0.49'
863
900
  VersionChanged: '0.82'
864
- # By default, the indentation width from Layout/IndentationWidth is used
865
- # But it can be overridden by setting this parameter
901
+ # By default the indentation width from `Layout/IndentationWidth` is used,
902
+ # but it can be overridden by setting this parameter.
866
903
  # It is used during auto-correction to determine how many spaces should
867
904
  # replace each tab.
868
905
  IndentationWidth: ~
@@ -901,13 +938,26 @@ Layout/LeadingEmptyLines:
901
938
  VersionAdded: '0.57'
902
939
  VersionChanged: '0.77'
903
940
 
941
+ Layout/LineEndStringConcatenationIndentation:
942
+ Description: >-
943
+ Checks the indentation of the next line after a line that
944
+ ends with a string literal and a backslash.
945
+ Enabled: pending
946
+ VersionAdded: '1.18'
947
+ EnforcedStyle: aligned
948
+ SupportedStyles:
949
+ - aligned
950
+ - indented
951
+ # By default the indentation width from `Layout/IndentationWidth` is used,
952
+ # but it can be overridden by setting this parameter.
953
+ IndentationWidth: ~
954
+
904
955
  Layout/LineLength:
905
956
  Description: 'Checks that line length does not exceed the configured limit.'
906
957
  StyleGuide: '#max-line-length'
907
958
  Enabled: true
908
959
  VersionAdded: '0.25'
909
960
  VersionChanged: '1.4'
910
- AutoCorrect: true
911
961
  Max: 120
912
962
  # To make it possible to copy or click on URIs in the code, we allow lines
913
963
  # containing a URI to be longer than Max.
@@ -1031,8 +1081,8 @@ Layout/MultilineMethodCallIndentation:
1031
1081
  - aligned
1032
1082
  - indented
1033
1083
  - indented_relative_to_receiver
1034
- # By default, the indentation width from Layout/IndentationWidth is used
1035
- # But it can be overridden by setting this parameter
1084
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1085
+ # but it can be overridden by setting this parameter.
1036
1086
  IndentationWidth: ~
1037
1087
 
1038
1088
  Layout/MultilineMethodDefinitionBraceLayout:
@@ -1061,8 +1111,8 @@ Layout/MultilineOperationIndentation:
1061
1111
  SupportedStyles:
1062
1112
  - aligned
1063
1113
  - indented
1064
- # By default, the indentation width from `Layout/IndentationWidth` is used
1065
- # But it can be overridden by setting this parameter
1114
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1115
+ # but it can be overridden by setting this parameter.
1066
1116
  IndentationWidth: ~
1067
1117
 
1068
1118
  Layout/ParameterAlignment:
@@ -1090,15 +1140,28 @@ Layout/ParameterAlignment:
1090
1140
  SupportedStyles:
1091
1141
  - with_first_parameter
1092
1142
  - with_fixed_indentation
1093
- # By default, the indentation width from Layout/IndentationWidth is used
1094
- # But it can be overridden by setting this parameter
1143
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1144
+ # but it can be overridden by setting this parameter.
1095
1145
  IndentationWidth: ~
1096
1146
 
1147
+ Layout/RedundantLineBreak:
1148
+ Description: >-
1149
+ Do not break up an expression into multiple lines when it fits
1150
+ on a single line.
1151
+ Enabled: false
1152
+ InspectBlocks: false
1153
+ VersionAdded: '1.13'
1154
+
1097
1155
  Layout/RescueEnsureAlignment:
1098
1156
  Description: 'Align rescues and ensures correctly.'
1099
1157
  Enabled: true
1100
1158
  VersionAdded: '0.49'
1101
1159
 
1160
+ Layout/SingleLineBlockChain:
1161
+ Description: 'Put method call on a separate line if chained to a single line block.'
1162
+ Enabled: false
1163
+ VersionAdded: '1.14'
1164
+
1102
1165
  Layout/SpaceAfterColon:
1103
1166
  Description: 'Use spaces after colons.'
1104
1167
  StyleGuide: '#spaces-operators'
@@ -1298,10 +1361,11 @@ Layout/SpaceInsideParens:
1298
1361
  StyleGuide: '#spaces-braces'
1299
1362
  Enabled: true
1300
1363
  VersionAdded: '0.49'
1301
- VersionChanged: '0.55'
1364
+ VersionChanged: '1.22'
1302
1365
  EnforcedStyle: no_space
1303
1366
  SupportedStyles:
1304
1367
  - space
1368
+ - compact
1305
1369
  - no_space
1306
1370
 
1307
1371
  Layout/SpaceInsidePercentLiteralDelimiters:
@@ -1373,6 +1437,8 @@ Lint/AmbiguousBlockAssociation:
1373
1437
  StyleGuide: '#syntax'
1374
1438
  Enabled: true
1375
1439
  VersionAdded: '0.48'
1440
+ VersionChanged: '1.13'
1441
+ IgnoredMethods: []
1376
1442
 
1377
1443
  Lint/AmbiguousOperator:
1378
1444
  Description: >-
@@ -1383,6 +1449,20 @@ Lint/AmbiguousOperator:
1383
1449
  VersionAdded: '0.17'
1384
1450
  VersionChanged: '0.83'
1385
1451
 
1452
+ Lint/AmbiguousOperatorPrecedence:
1453
+ Description: >-
1454
+ Checks for expressions containing multiple binary operations with
1455
+ ambiguous precedence.
1456
+ Enabled: pending
1457
+ VersionAdded: '1.21'
1458
+
1459
+ Lint/AmbiguousRange:
1460
+ Description: Checks for ranges with ambiguous boundaries.
1461
+ Enabled: pending
1462
+ VersionAdded: '1.19'
1463
+ SafeAutoCorrect: false
1464
+ RequireParenthesesForMethodChains: false
1465
+
1386
1466
  Lint/AmbiguousRegexpLiteral:
1387
1467
  Description: >-
1388
1468
  Checks for ambiguous regexp literals in the first argument of
@@ -1413,9 +1493,9 @@ Lint/BinaryOperatorWithIdenticalOperands:
1413
1493
  Lint/BooleanSymbol:
1414
1494
  Description: 'Check for `:true` and `:false` symbols.'
1415
1495
  Enabled: true
1416
- Safe: false
1496
+ SafeAutoCorrect: false
1417
1497
  VersionAdded: '0.50'
1418
- VersionChanged: '0.83'
1498
+ VersionChanged: '1.22'
1419
1499
 
1420
1500
  Lint/CircularArgumentReference:
1421
1501
  Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
@@ -1446,23 +1526,38 @@ Lint/Debugger:
1446
1526
  Description: 'Check for debugger calls.'
1447
1527
  Enabled: true
1448
1528
  VersionAdded: '0.14'
1449
- VersionChanged: '0.49'
1450
- DebuggerReceivers:
1451
- - binding
1452
- - Kernel
1453
- - Pry
1529
+ VersionChanged: '1.10'
1530
+ DebuggerReceivers: [] # deprecated
1454
1531
  DebuggerMethods:
1455
- - debugger
1456
- - byebug
1457
- - remote_byebug
1458
- - pry
1459
- - remote_pry
1460
- - pry_remote
1461
- - console
1462
- - rescue
1463
- - save_and_open_page
1464
- - save_and_open_screenshot
1465
- - irb
1532
+ # Groups are available so that a specific group can be disabled in
1533
+ # a user's configuration, but are otherwise not significant.
1534
+ Kernel:
1535
+ - binding.irb
1536
+ Byebug:
1537
+ - byebug
1538
+ - remote_byebug
1539
+ - Kernel.byebug
1540
+ - Kernel.remote_byebug
1541
+ Capybara:
1542
+ - save_and_open_page
1543
+ - save_and_open_screenshot
1544
+ debug.rb:
1545
+ - binding.b
1546
+ - binding.break
1547
+ - Kernel.binding.b
1548
+ - Kernel.binding.break
1549
+ Pry:
1550
+ - binding.pry
1551
+ - binding.remote_pry
1552
+ - binding.pry_remote
1553
+ - Pry.rescue
1554
+ Rails:
1555
+ - debugger
1556
+ - Kernel.debugger
1557
+ RubyJard:
1558
+ - jard
1559
+ WebConsole:
1560
+ - binding.console
1466
1561
 
1467
1562
  Lint/DeprecatedClassMethods:
1468
1563
  Description: 'Check for deprecated class method calls.'
@@ -1473,6 +1568,7 @@ Lint/DeprecatedConstants:
1473
1568
  Description: 'Checks for deprecated constants.'
1474
1569
  Enabled: pending
1475
1570
  VersionAdded: '1.8'
1571
+ VersionChanged: '1.22'
1476
1572
  # You can configure deprecated constants.
1477
1573
  # If there is an alternative method, you can set alternative value as `Alternative`.
1478
1574
  # And you can set the deprecated version as `DeprecatedVersion`.
@@ -1493,6 +1589,9 @@ Lint/DeprecatedConstants:
1493
1589
  'FALSE':
1494
1590
  Alternative: 'false'
1495
1591
  DeprecatedVersion: '2.4'
1592
+ 'Net::HTTPServerException':
1593
+ Alternative: 'Net::HTTPClientException'
1594
+ DeprecatedVersion: '2.6'
1496
1595
  'Random::DEFAULT':
1497
1596
  Alternative: 'Random.new'
1498
1597
  DeprecatedVersion: '3.0'
@@ -1568,7 +1667,7 @@ Lint/EmptyBlock:
1568
1667
  Description: 'This cop checks for blocks without a body.'
1569
1668
  Enabled: pending
1570
1669
  VersionAdded: '1.1'
1571
- VersionChanged: '1.3'
1670
+ VersionChanged: '1.15'
1572
1671
  AllowComments: true
1573
1672
  AllowEmptyLambdas: true
1574
1673
 
@@ -1601,6 +1700,12 @@ Lint/EmptyFile:
1601
1700
  AllowComments: true
1602
1701
  VersionAdded: '0.90'
1603
1702
 
1703
+ Lint/EmptyInPattern:
1704
+ Description: 'Checks for the presence of `in` pattern branches without a body.'
1705
+ Enabled: pending
1706
+ AllowComments: true
1707
+ VersionAdded: '1.16'
1708
+
1604
1709
  Lint/EmptyInterpolation:
1605
1710
  Description: 'Checks for empty string interpolation.'
1606
1711
  Enabled: true
@@ -1678,6 +1783,11 @@ Lint/ImplicitStringConcatenation:
1678
1783
  Enabled: true
1679
1784
  VersionAdded: '0.36'
1680
1785
 
1786
+ Lint/IncompatibleIoSelectWithFiberScheduler:
1787
+ Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
1788
+ Enabled: pending
1789
+ VersionAdded: '1.21'
1790
+
1681
1791
  Lint/IneffectiveAccessModifier:
1682
1792
  Description: >-
1683
1793
  Checks for attempts to use `private` or `protected` to set
@@ -1744,7 +1854,7 @@ Lint/MissingCopEnableDirective:
1744
1854
  Lint/MissingSuper:
1745
1855
  Description: >-
1746
1856
  This cop checks for the presence of constructors and lifecycle callbacks
1747
- without calls to `super`'.
1857
+ without calls to `super`.
1748
1858
  Enabled: true
1749
1859
  VersionAdded: '0.89'
1750
1860
  VersionChanged: '1.4'
@@ -1759,7 +1869,6 @@ Lint/MultipleComparison:
1759
1869
  Enabled: true
1760
1870
  VersionAdded: '0.47'
1761
1871
  VersionChanged: '1.1'
1762
- AllowMethodComparison: true
1763
1872
 
1764
1873
  Lint/NestedMethodDefinition:
1765
1874
  Description: 'Do not use nested method definitions.'
@@ -1942,6 +2051,11 @@ Lint/RequireParentheses:
1942
2051
  Enabled: true
1943
2052
  VersionAdded: '0.18'
1944
2053
 
2054
+ Lint/RequireRelativeSelfPath:
2055
+ Description: 'Checks for uses a file requiring itself with `require_relative`.'
2056
+ Enabled: pending
2057
+ VersionAdded: '1.22'
2058
+
1945
2059
  Lint/RescueException:
1946
2060
  Description: 'Avoid rescuing the Exception class.'
1947
2061
  StyleGuide: '#no-blind-rescues'
@@ -2040,13 +2154,19 @@ Lint/SuppressedException:
2040
2154
  StyleGuide: '#dont-hide-exceptions'
2041
2155
  Enabled: true
2042
2156
  AllowComments: true
2157
+ AllowNil: true
2043
2158
  VersionAdded: '0.9'
2044
- VersionChanged: '0.81'
2159
+ VersionChanged: '1.12'
2045
2160
 
2046
2161
  Lint/SymbolConversion:
2047
2162
  Description: 'Checks for unnecessary symbol conversions.'
2048
2163
  Enabled: pending
2049
2164
  VersionAdded: '1.9'
2165
+ VersionChanged: '1.16'
2166
+ EnforcedStyle: strict
2167
+ SupportedStyles:
2168
+ - strict
2169
+ - consistent
2050
2170
 
2051
2171
  Lint/Syntax:
2052
2172
  Description: 'Checks for syntax errors.'
@@ -2463,6 +2583,33 @@ Naming/HeredocDelimiterNaming:
2463
2583
  ForbiddenDelimiters:
2464
2584
  - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
2465
2585
 
2586
+ Naming/InclusiveLanguage:
2587
+ Description: 'Recommend the use of inclusive language instead of problematic terms.'
2588
+ Enabled: false
2589
+ VersionAdded: '1.18'
2590
+ VersionChanged: '1.21'
2591
+ CheckIdentifiers: true
2592
+ CheckConstants: true
2593
+ CheckVariables: true
2594
+ CheckStrings: false
2595
+ CheckSymbols: true
2596
+ CheckComments: true
2597
+ CheckFilepaths: true
2598
+ FlaggedTerms:
2599
+ whitelist:
2600
+ Regex: !ruby/regexp '/white[-_\s]?list/'
2601
+ Suggestions:
2602
+ - allowlist
2603
+ - permit
2604
+ blacklist:
2605
+ Regex: !ruby/regexp '/black[-_\s]?list/'
2606
+ Suggestions:
2607
+ - denylist
2608
+ - block
2609
+ slave:
2610
+ WholeWord: true
2611
+ Suggestions: ['replica', 'secondary', 'follower']
2612
+
2466
2613
  Naming/MemoizedInstanceVariableName:
2467
2614
  Description: >-
2468
2615
  Memoized method name should match memo instance variable name.
@@ -2474,6 +2621,7 @@ Naming/MemoizedInstanceVariableName:
2474
2621
  - disallowed
2475
2622
  - required
2476
2623
  - optional
2624
+ Safe: false
2477
2625
 
2478
2626
  Naming/MethodName:
2479
2627
  Description: 'Use the configured style when naming methods.'
@@ -2595,6 +2743,14 @@ Security/Eval:
2595
2743
  Enabled: true
2596
2744
  VersionAdded: '0.47'
2597
2745
 
2746
+ Security/IoMethods:
2747
+ Description: >-
2748
+ Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
2749
+ `IO.foreach`, and `IO.readlines`.
2750
+ Enabled: pending
2751
+ Safe: false
2752
+ VersionAdded: '1.22'
2753
+
2598
2754
  Security/JSONLoad:
2599
2755
  Description: >-
2600
2756
  Prefer usage of `JSON.parse` over `JSON.load` due to potential
@@ -2602,10 +2758,9 @@ Security/JSONLoad:
2602
2758
  Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
2603
2759
  Enabled: true
2604
2760
  VersionAdded: '0.43'
2605
- VersionChanged: '0.44'
2761
+ VersionChanged: '1.22'
2606
2762
  # Autocorrect here will change to a method that may cause crashes depending
2607
2763
  # on the value of the argument.
2608
- AutoCorrect: false
2609
2764
  SafeAutoCorrect: false
2610
2765
 
2611
2766
  Security/MarshalLoad:
@@ -2671,8 +2826,9 @@ Style/AndOr:
2671
2826
  Description: 'Use &&/|| instead of and/or.'
2672
2827
  StyleGuide: '#no-and-or-or'
2673
2828
  Enabled: true
2829
+ SafeAutoCorrect: false
2674
2830
  VersionAdded: '0.9'
2675
- VersionChanged: '0.25'
2831
+ VersionChanged: '1.21'
2676
2832
  # Whether `and` and `or` are banned only in conditionals (conditionals)
2677
2833
  # or completely (always).
2678
2834
  EnforcedStyle: conditionals
@@ -2706,9 +2862,9 @@ Style/ArrayJoin:
2706
2862
  Style/AsciiComments:
2707
2863
  Description: 'Use only ascii symbols in comments.'
2708
2864
  StyleGuide: '#english-comments'
2709
- Enabled: true
2865
+ Enabled: false
2710
2866
  VersionAdded: '0.9'
2711
- VersionChanged: '0.52'
2867
+ VersionChanged: '1.21'
2712
2868
  AllowedChars:
2713
2869
  - ©
2714
2870
 
@@ -2870,7 +3026,7 @@ Style/CaseEquality:
2870
3026
  Enabled: true
2871
3027
  VersionAdded: '0.9'
2872
3028
  VersionChanged: '0.89'
2873
- # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
3029
+ # If `AllowOnConstant` option is enabled, the cop will ignore violations when the receiver of
2874
3030
  # the case equality operator is a constant.
2875
3031
  #
2876
3032
  # # bad
@@ -3045,7 +3201,7 @@ Style/CommentAnnotation:
3045
3201
  StyleGuide: '#annotate-keywords'
3046
3202
  Enabled: true
3047
3203
  VersionAdded: '0.10'
3048
- VersionChanged: '1.3'
3204
+ VersionChanged: '1.20'
3049
3205
  Keywords:
3050
3206
  - TODO
3051
3207
  - FIXME
@@ -3053,12 +3209,14 @@ Style/CommentAnnotation:
3053
3209
  - HACK
3054
3210
  - REVIEW
3055
3211
  - NOTE
3212
+ RequireColon: true
3056
3213
 
3057
3214
  Style/CommentedKeyword:
3058
3215
  Description: 'Do not place comments on the same line as certain keywords.'
3059
3216
  Enabled: true
3217
+ SafeAutoCorrect: false
3060
3218
  VersionAdded: '0.51'
3061
- VersionChanged: '1.7'
3219
+ VersionChanged: '1.19'
3062
3220
 
3063
3221
  Style/ConditionalAssignment:
3064
3222
  Description: >-
@@ -3087,6 +3245,8 @@ Style/ConstantVisibility:
3087
3245
  visibility declarations.
3088
3246
  Enabled: false
3089
3247
  VersionAdded: '0.66'
3248
+ VersionChanged: '1.10'
3249
+ IgnoreModules: false
3090
3250
 
3091
3251
  # Checks that you have put a copyright in a comment before any code.
3092
3252
  #
@@ -3157,6 +3317,7 @@ Style/Documentation:
3157
3317
  Description: 'Document classes and non-namespace modules.'
3158
3318
  Enabled: true
3159
3319
  VersionAdded: '0.9'
3320
+ AllowedConstants: []
3160
3321
  Exclude:
3161
3322
  - 'spec/**/*'
3162
3323
  - 'test/**/*'
@@ -3425,12 +3586,22 @@ Style/HashAsLastArrayItem:
3425
3586
  - braces
3426
3587
  - no_braces
3427
3588
 
3589
+ Style/HashConversion:
3590
+ Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
3591
+ StyleGuide: '#avoid-hash-constructor'
3592
+ Enabled: pending
3593
+ VersionAdded: '1.10'
3594
+ VersionChanged: '1.11'
3595
+ AllowSplatArgument: true
3596
+
3428
3597
  Style/HashEachMethods:
3429
3598
  Description: 'Use Hash#each_key and Hash#each_value.'
3430
3599
  StyleGuide: '#hash-each'
3431
3600
  Enabled: true
3432
- VersionAdded: '0.80'
3433
3601
  Safe: false
3602
+ VersionAdded: '0.80'
3603
+ VersionChanged: '1.16'
3604
+ AllowedReceivers: []
3434
3605
 
3435
3606
  Style/HashExcept:
3436
3607
  Description: >-
@@ -3492,7 +3663,9 @@ Style/IdenticalConditionalBranches:
3492
3663
  line at the end of each branch, which can validly be moved
3493
3664
  out of the conditional.
3494
3665
  Enabled: true
3666
+ SafeAutoCorrect: false
3495
3667
  VersionAdded: '0.36'
3668
+ VersionChanged: '1.19'
3496
3669
 
3497
3670
  Style/IfInsideElse:
3498
3671
  Description: 'Finds if nodes inside else, which can be converted to elsif.'
@@ -3539,10 +3712,16 @@ Style/ImplicitRuntimeError:
3539
3712
  Enabled: false
3540
3713
  VersionAdded: '0.41'
3541
3714
 
3715
+ Style/InPatternThen:
3716
+ Description: 'Checks for `in;` uses in `case` expressions.'
3717
+ StyleGuide: '#no-in-pattern-semicolons'
3718
+ Enabled: pending
3719
+ VersionAdded: '1.16'
3720
+
3542
3721
  Style/InfiniteLoop:
3543
3722
  Description: >-
3544
3723
  Use Kernel#loop for infinite loops.
3545
- This cop is unsafe in the body may raise a `StopIteration` exception.
3724
+ This cop is unsafe if the body may raise a `StopIteration` exception.
3546
3725
  Safe: false
3547
3726
  StyleGuide: '#infinite-loop'
3548
3727
  Enabled: true
@@ -3648,6 +3827,7 @@ Style/MethodCallWithArgsParentheses:
3648
3827
  AllowParenthesesInMultilineCall: false
3649
3828
  AllowParenthesesInChaining: false
3650
3829
  AllowParenthesesInCamelCaseMethod: false
3830
+ AllowParenthesesInStringInterpolation: false
3651
3831
  EnforcedStyle: require_parentheses
3652
3832
  SupportedStyles:
3653
3833
  - require_parentheses
@@ -3766,6 +3946,12 @@ Style/MultilineIfThen:
3766
3946
  VersionAdded: '0.9'
3767
3947
  VersionChanged: '0.26'
3768
3948
 
3949
+ Style/MultilineInPatternThen:
3950
+ Description: 'Do not use `then` for multi-line `in` statement.'
3951
+ StyleGuide: '#no-then'
3952
+ Enabled: pending
3953
+ VersionAdded: '1.16'
3954
+
3769
3955
  Style/MultilineMemoization:
3770
3956
  Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
3771
3957
  Enabled: true
@@ -3804,6 +3990,7 @@ Style/MultipleComparison:
3804
3990
  Enabled: true
3805
3991
  VersionAdded: '0.49'
3806
3992
  VersionChanged: '1.1'
3993
+ AllowMethodComparison: true
3807
3994
 
3808
3995
  Style/MutableConstant:
3809
3996
  Description: 'Do not assign mutable objects to constants.'
@@ -3937,6 +4124,7 @@ Style/NilLambda:
3937
4124
  Description: 'Prefer `-> {}` to `-> { nil }`.'
3938
4125
  Enabled: pending
3939
4126
  VersionAdded: '1.3'
4127
+ VersionChanged: '1.15'
3940
4128
 
3941
4129
  Style/NonNilCheck:
3942
4130
  Description: 'Checks for redundant nil checks.'
@@ -3959,6 +4147,21 @@ Style/Not:
3959
4147
  VersionAdded: '0.9'
3960
4148
  VersionChanged: '0.20'
3961
4149
 
4150
+ Style/NumberedParameters:
4151
+ Description: 'Restrict the usage of numbered parameters.'
4152
+ Enabled: pending
4153
+ VersionAdded: '1.22'
4154
+ EnforcedStyle: allow_single_line
4155
+ SupportedStyles:
4156
+ - allow_single_line
4157
+ - disallow
4158
+
4159
+ Style/NumberedParametersLimit:
4160
+ Description: 'Avoid excessive numbered params in a single block.'
4161
+ Enabled: pending
4162
+ VersionAdded: '1.22'
4163
+ Max: 1
4164
+
3962
4165
  Style/NumericLiteralPrefix:
3963
4166
  Description: 'Use smallcase prefixes for numeric literals.'
3964
4167
  StyleGuide: '#numeric-literal-prefixes'
@@ -3969,7 +4172,6 @@ Style/NumericLiteralPrefix:
3969
4172
  - zero_with_o
3970
4173
  - zero_only
3971
4174
 
3972
-
3973
4175
  Style/NumericLiterals:
3974
4176
  Description: >-
3975
4177
  Add underscores to large numeric literals to improve their
@@ -4026,6 +4228,7 @@ Style/OptionHash:
4026
4228
  - args
4027
4229
  - params
4028
4230
  - parameters
4231
+ Allowlist: []
4029
4232
 
4030
4233
  Style/OptionalArguments:
4031
4234
  Description: >-
@@ -4123,6 +4326,16 @@ Style/Proc:
4123
4326
  VersionAdded: '0.9'
4124
4327
  VersionChanged: '0.18'
4125
4328
 
4329
+ Style/QuotedSymbols:
4330
+ Description: 'Use a consistent style for quoted symbols.'
4331
+ Enabled: pending
4332
+ VersionAdded: '1.16'
4333
+ EnforcedStyle: same_as_string_literals
4334
+ SupportedStyles:
4335
+ - same_as_string_literals
4336
+ - single_quotes
4337
+ - double_quotes
4338
+
4126
4339
  Style/RaiseArgs:
4127
4340
  Description: 'Checks the arguments passed to raise/fail.'
4128
4341
  StyleGuide: '#exception-class-messages'
@@ -4268,12 +4481,19 @@ Style/RedundantSelfAssignment:
4268
4481
  Safe: false
4269
4482
  VersionAdded: '0.90'
4270
4483
 
4484
+ Style/RedundantSelfAssignmentBranch:
4485
+ Description: 'Checks for places where conditional branch makes redundant self-assignment.'
4486
+ Enabled: pending
4487
+ VersionAdded: '1.19'
4488
+
4271
4489
  Style/RedundantSort:
4272
4490
  Description: >-
4273
4491
  Use `min` instead of `sort.first`,
4274
4492
  `max_by` instead of `sort_by...last`, etc.
4275
4493
  Enabled: true
4276
4494
  VersionAdded: '0.76'
4495
+ VersionChanged: '1.22'
4496
+ Safe: false
4277
4497
 
4278
4498
  Style/RedundantSortBy:
4279
4499
  Description: 'Use `sort` instead of `sort_by { |x| x }`.'
@@ -4354,6 +4574,12 @@ Style/Sample:
4354
4574
  Enabled: true
4355
4575
  VersionAdded: '0.30'
4356
4576
 
4577
+ Style/SelectByRegexp:
4578
+ Description: 'Prefer grep/grep_v to select/reject with a regexp match.'
4579
+ Enabled: pending
4580
+ SafeAutoCorrect: false
4581
+ VersionAdded: '1.22'
4582
+
4357
4583
  Style/SelfAssignment:
4358
4584
  Description: >-
4359
4585
  Checks for places where self-assignment shorthand should have
@@ -4439,6 +4665,7 @@ Style/SpecialGlobalVars:
4439
4665
  VersionAdded: '0.13'
4440
4666
  VersionChanged: '0.36'
4441
4667
  SafeAutoCorrect: false
4668
+ RequireEnglish: true
4442
4669
  EnforcedStyle: use_english_names
4443
4670
  SupportedStyles:
4444
4671
  - use_perl_names
@@ -4467,13 +4694,21 @@ Style/StderrPuts:
4467
4694
  Enabled: true
4468
4695
  VersionAdded: '0.51'
4469
4696
 
4697
+ Style/StringChars:
4698
+ Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
4699
+ StyleGuide: '#string-chars'
4700
+ Enabled: pending
4701
+ Safe: false
4702
+ VersionAdded: '1.12'
4703
+
4470
4704
  Style/StringConcatenation:
4471
4705
  Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
4472
4706
  StyleGuide: '#string-interpolation'
4473
4707
  Enabled: true
4474
4708
  Safe: false
4475
4709
  VersionAdded: '0.89'
4476
- VersionChanged: '1.6'
4710
+ VersionChanged: '1.18'
4711
+ Mode: aggressive
4477
4712
 
4478
4713
  Style/StringHashKeys:
4479
4714
  Description: 'Prefer symbols instead of strings as hash keys.'
@@ -4531,8 +4766,9 @@ Style/StructInheritance:
4531
4766
  Description: 'Checks for inheritance from Struct.new.'
4532
4767
  StyleGuide: '#no-extend-struct-new'
4533
4768
  Enabled: true
4769
+ SafeAutoCorrect: false
4534
4770
  VersionAdded: '0.29'
4535
- VersionChanged: '0.86'
4771
+ VersionChanged: '1.20'
4536
4772
 
4537
4773
  Style/SwapValues:
4538
4774
  Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
@@ -4564,6 +4800,7 @@ Style/SymbolProc:
4564
4800
  Safe: false
4565
4801
  VersionAdded: '0.26'
4566
4802
  VersionChanged: '1.5'
4803
+ AllowMethodsWithArguments: false
4567
4804
  # A list of method names to be ignored by the check.
4568
4805
  # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
4569
4806
  IgnoredMethods:
@@ -4582,6 +4819,12 @@ Style/TernaryParentheses:
4582
4819
  - require_parentheses_when_complex
4583
4820
  AllowSafeAssignment: true
4584
4821
 
4822
+ Style/TopLevelMethodDefinition:
4823
+ Description: 'This cop looks for top-level method definitions.'
4824
+ StyleGuide: '#top-level-methods'
4825
+ Enabled: false
4826
+ VersionAdded: '1.15'
4827
+
4585
4828
  Style/TrailingBodyOnClass:
4586
4829
  Description: 'Class body goes below class statement.'
4587
4830
  Enabled: true
@@ -4668,7 +4911,7 @@ Style/TrivialAccessors:
4668
4911
  StyleGuide: '#attr_family'
4669
4912
  Enabled: true
4670
4913
  VersionAdded: '0.9'
4671
- VersionChanged: '0.77'
4914
+ VersionChanged: '1.15'
4672
4915
  # When set to `false` the cop will suggest the use of accessor methods
4673
4916
  # in situations like:
4674
4917
  #
@@ -4687,7 +4930,7 @@ Style/TrivialAccessors:
4687
4930
  # on_exception :restart
4688
4931
  #
4689
4932
  # Commonly used in DSLs
4690
- AllowDSLWriters: false
4933
+ AllowDSLWriters: true
4691
4934
  IgnoreClassMethods: false
4692
4935
  AllowedMethods:
4693
4936
  - to_ary
@@ -4716,6 +4959,16 @@ Style/UnlessElse:
4716
4959
  Enabled: true
4717
4960
  VersionAdded: '0.9'
4718
4961
 
4962
+ Style/UnlessLogicalOperators:
4963
+ Description: >-
4964
+ Checks for use of logical operators in an unless condition.
4965
+ Enabled: false
4966
+ VersionAdded: '1.11'
4967
+ EnforcedStyle: forbid_mixed_logical_operators
4968
+ SupportedStyles:
4969
+ - forbid_mixed_logical_operators
4970
+ - forbid_logical_operators
4971
+
4719
4972
  Style/UnpackFirst:
4720
4973
  Description: >-
4721
4974
  Checks for accessing the first element of `String#unpack`
@@ -4734,7 +4987,7 @@ Style/VariableInterpolation:
4734
4987
 
4735
4988
  Style/WhenThen:
4736
4989
  Description: 'Use when x then ... for one-line cases.'
4737
- StyleGuide: '#one-line-cases'
4990
+ StyleGuide: '#no-when-semicolons'
4738
4991
  Enabled: true
4739
4992
  VersionAdded: '0.9'
4740
4993
 
@@ -4758,7 +5011,7 @@ Style/WordArray:
4758
5011
  StyleGuide: '#percent-w'
4759
5012
  Enabled: true
4760
5013
  VersionAdded: '0.9'
4761
- VersionChanged: '0.36'
5014
+ VersionChanged: '1.19'
4762
5015
  EnforcedStyle: percent
4763
5016
  SupportedStyles:
4764
5017
  # percent style: %w(word1 word2)