rubocop 0.80.0 → 0.84.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (293) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/config/default.yml +171 -34
  4. data/lib/rubocop.rb +15 -62
  5. data/lib/rubocop/ast_aliases.rb +8 -0
  6. data/lib/rubocop/cli.rb +11 -5
  7. data/lib/rubocop/cli/command/show_cops.rb +2 -6
  8. data/lib/rubocop/config.rb +41 -13
  9. data/lib/rubocop/config_loader.rb +40 -36
  10. data/lib/rubocop/config_loader_resolver.rb +27 -4
  11. data/lib/rubocop/config_obsoletion.rb +2 -0
  12. data/lib/rubocop/config_validator.rb +18 -1
  13. data/lib/rubocop/cop/autocorrect_logic.rb +1 -2
  14. data/lib/rubocop/cop/badge.rb +5 -5
  15. data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +1 -1
  16. data/lib/rubocop/cop/corrector.rb +49 -27
  17. data/lib/rubocop/cop/correctors/alignment_corrector.rb +4 -8
  18. data/lib/rubocop/cop/correctors/condition_corrector.rb +1 -2
  19. data/lib/rubocop/cop/correctors/empty_line_corrector.rb +1 -1
  20. data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +3 -3
  21. data/lib/rubocop/cop/correctors/line_break_corrector.rb +2 -2
  22. data/lib/rubocop/cop/correctors/parentheses_corrector.rb +1 -3
  23. data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
  24. data/lib/rubocop/cop/correctors/space_corrector.rb +1 -3
  25. data/lib/rubocop/cop/correctors/string_literal_corrector.rb +2 -2
  26. data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -3
  27. data/lib/rubocop/cop/generator.rb +4 -3
  28. data/lib/rubocop/cop/ignored_node.rb +1 -3
  29. data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +1 -1
  30. data/lib/rubocop/cop/layout/array_alignment.rb +53 -10
  31. data/lib/rubocop/cop/layout/block_end_newline.rb +5 -3
  32. data/lib/rubocop/cop/layout/condition_position.rb +12 -2
  33. data/lib/rubocop/cop/layout/dot_position.rb +1 -1
  34. data/lib/rubocop/cop/layout/else_alignment.rb +8 -0
  35. data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +2 -6
  36. data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +126 -0
  37. data/lib/rubocop/cop/layout/end_of_line.rb +2 -2
  38. data/lib/rubocop/cop/layout/first_argument_indentation.rb +0 -2
  39. data/lib/rubocop/cop/layout/first_array_element_indentation.rb +14 -10
  40. data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +1 -1
  41. data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -3
  42. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +4 -8
  43. data/lib/rubocop/cop/layout/heredoc_indentation.rb +2 -2
  44. data/lib/rubocop/cop/layout/{tab.rb → indentation_style.rb} +48 -6
  45. data/lib/rubocop/cop/layout/indentation_width.rb +1 -3
  46. data/lib/rubocop/cop/layout/leading_comment_space.rb +1 -1
  47. data/lib/rubocop/cop/layout/line_length.rb +7 -4
  48. data/lib/rubocop/cop/layout/multiline_block_layout.rb +2 -4
  49. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -3
  50. data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +1 -1
  51. data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +13 -4
  52. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +3 -3
  53. data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +129 -0
  54. data/lib/rubocop/cop/layout/space_around_operators.rb +19 -2
  55. data/lib/rubocop/cop/layout/space_before_comment.rb +1 -3
  56. data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +1 -1
  57. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +1 -3
  58. data/lib/rubocop/cop/layout/space_inside_block_braces.rb +2 -2
  59. data/lib/rubocop/cop/layout/space_inside_range_literal.rb +2 -2
  60. data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +2 -6
  61. data/lib/rubocop/cop/layout/trailing_whitespace.rb +2 -2
  62. data/lib/rubocop/cop/lint/ambiguous_operator.rb +40 -0
  63. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +14 -0
  64. data/lib/rubocop/cop/lint/boolean_symbol.rb +12 -0
  65. data/lib/rubocop/cop/lint/debugger.rb +1 -1
  66. data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +133 -0
  67. data/lib/rubocop/cop/lint/duplicate_methods.rb +1 -5
  68. data/lib/rubocop/cop/lint/empty_when.rb +29 -6
  69. data/lib/rubocop/cop/lint/ensure_return.rb +18 -1
  70. data/lib/rubocop/cop/lint/erb_new_arguments.rb +3 -7
  71. data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +1 -1
  72. data/lib/rubocop/cop/lint/inherit_exception.rb +1 -1
  73. data/lib/rubocop/cop/lint/interpolation_check.rb +1 -1
  74. data/lib/rubocop/cop/lint/literal_as_condition.rb +10 -13
  75. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
  76. data/lib/rubocop/cop/lint/loop.rb +6 -4
  77. data/lib/rubocop/cop/lint/multiple_comparison.rb +1 -1
  78. data/lib/rubocop/cop/lint/nested_method_definition.rb +2 -2
  79. data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +2 -2
  80. data/lib/rubocop/cop/lint/number_conversion.rb +1 -1
  81. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +31 -11
  82. data/lib/rubocop/cop/lint/percent_string_array.rb +2 -4
  83. data/lib/rubocop/cop/lint/raise_exception.rb +75 -0
  84. data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +1 -6
  85. data/lib/rubocop/cop/lint/redundant_string_coercion.rb +1 -1
  86. data/lib/rubocop/cop/lint/safe_navigation_chain.rb +1 -1
  87. data/lib/rubocop/cop/lint/struct_new_override.rb +58 -0
  88. data/lib/rubocop/cop/lint/suppressed_exception.rb +20 -25
  89. data/lib/rubocop/cop/lint/syntax.rb +1 -3
  90. data/lib/rubocop/cop/lint/unified_integer.rb +0 -2
  91. data/lib/rubocop/cop/lint/unused_method_argument.rb +32 -6
  92. data/lib/rubocop/cop/lint/uri_regexp.rb +4 -4
  93. data/lib/rubocop/cop/lint/useless_access_modifier.rb +13 -3
  94. data/lib/rubocop/cop/lint/useless_assignment.rb +3 -2
  95. data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +5 -0
  96. data/lib/rubocop/cop/migration/department_name.rb +21 -12
  97. data/lib/rubocop/cop/mixin/alignment.rb +1 -3
  98. data/lib/rubocop/cop/mixin/array_min_size.rb +2 -6
  99. data/lib/rubocop/cop/mixin/check_line_breakable.rb +4 -12
  100. data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +1 -3
  101. data/lib/rubocop/cop/mixin/configurable_formatting.rb +1 -3
  102. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +6 -1
  103. data/lib/rubocop/cop/mixin/frozen_string_literal.rb +10 -1
  104. data/lib/rubocop/cop/mixin/hash_transform_method.rb +9 -3
  105. data/lib/rubocop/cop/mixin/line_length_help.rb +2 -1
  106. data/lib/rubocop/cop/mixin/method_complexity.rb +5 -0
  107. data/lib/rubocop/cop/mixin/multiline_element_indentation.rb +1 -3
  108. data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -1
  109. data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -22
  110. data/lib/rubocop/cop/mixin/surrounding_space.rb +1 -3
  111. data/lib/rubocop/cop/mixin/target_ruby_version.rb +5 -1
  112. data/lib/rubocop/cop/mixin/trailing_comma.rb +2 -4
  113. data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +1 -1
  114. data/lib/rubocop/cop/naming/constant_name.rb +2 -1
  115. data/lib/rubocop/cop/naming/file_name.rb +1 -3
  116. data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +1 -1
  117. data/lib/rubocop/cop/naming/method_name.rb +26 -0
  118. data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +1 -1
  119. data/lib/rubocop/cop/registry.rb +13 -10
  120. data/lib/rubocop/cop/severity.rb +1 -3
  121. data/lib/rubocop/cop/style/access_modifier_declarations.rb +26 -6
  122. data/lib/rubocop/cop/style/alias.rb +4 -4
  123. data/lib/rubocop/cop/style/and_or.rb +7 -8
  124. data/lib/rubocop/cop/style/array_join.rb +1 -1
  125. data/lib/rubocop/cop/style/attr.rb +1 -3
  126. data/lib/rubocop/cop/style/block_delimiters.rb +2 -8
  127. data/lib/rubocop/cop/style/case_equality.rb +24 -1
  128. data/lib/rubocop/cop/style/character_literal.rb +2 -2
  129. data/lib/rubocop/cop/style/collection_methods.rb +2 -0
  130. data/lib/rubocop/cop/style/conditional_assignment.rb +9 -11
  131. data/lib/rubocop/cop/style/copyright.rb +1 -1
  132. data/lib/rubocop/cop/style/dir.rb +1 -1
  133. data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -0
  134. data/lib/rubocop/cop/style/documentation.rb +43 -5
  135. data/lib/rubocop/cop/style/double_cop_disable_directive.rb +1 -1
  136. data/lib/rubocop/cop/style/double_negation.rb +41 -4
  137. data/lib/rubocop/cop/style/each_for_simple_loop.rb +1 -1
  138. data/lib/rubocop/cop/style/each_with_object.rb +3 -3
  139. data/lib/rubocop/cop/style/empty_literal.rb +1 -3
  140. data/lib/rubocop/cop/style/empty_method.rb +1 -5
  141. data/lib/rubocop/cop/style/end_block.rb +6 -0
  142. data/lib/rubocop/cop/style/even_odd.rb +1 -1
  143. data/lib/rubocop/cop/style/expand_path_arguments.rb +3 -3
  144. data/lib/rubocop/cop/style/exponential_notation.rb +119 -0
  145. data/lib/rubocop/cop/style/format_string.rb +2 -2
  146. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +2 -4
  147. data/lib/rubocop/cop/style/guard_clause.rb +25 -2
  148. data/lib/rubocop/cop/style/hash_each_methods.rb +5 -3
  149. data/lib/rubocop/cop/style/hash_syntax.rb +15 -10
  150. data/lib/rubocop/cop/style/hash_transform_keys.rb +6 -2
  151. data/lib/rubocop/cop/style/hash_transform_values.rb +6 -5
  152. data/lib/rubocop/cop/style/if_unless_modifier.rb +23 -3
  153. data/lib/rubocop/cop/style/if_with_semicolon.rb +16 -0
  154. data/lib/rubocop/cop/style/inverse_methods.rb +9 -5
  155. data/lib/rubocop/cop/style/lambda.rb +3 -2
  156. data/lib/rubocop/cop/style/lambda_call.rb +1 -21
  157. data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +1 -3
  158. data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +1 -3
  159. data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
  160. data/lib/rubocop/cop/style/module_function.rb +58 -12
  161. data/lib/rubocop/cop/style/multiline_if_modifier.rb +1 -1
  162. data/lib/rubocop/cop/style/multiline_memoization.rb +1 -1
  163. data/lib/rubocop/cop/style/multiline_when_then.rb +16 -1
  164. data/lib/rubocop/cop/style/mutable_constant.rb +2 -4
  165. data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +4 -4
  166. data/lib/rubocop/cop/style/next.rb +2 -2
  167. data/lib/rubocop/cop/style/nil_comparison.rb +1 -1
  168. data/lib/rubocop/cop/style/non_nil_check.rb +4 -4
  169. data/lib/rubocop/cop/style/not.rb +1 -1
  170. data/lib/rubocop/cop/style/numeric_literal_prefix.rb +1 -1
  171. data/lib/rubocop/cop/style/numeric_literals.rb +1 -1
  172. data/lib/rubocop/cop/style/numeric_predicate.rb +1 -1
  173. data/lib/rubocop/cop/style/one_line_conditional.rb +6 -9
  174. data/lib/rubocop/cop/style/optional_arguments.rb +1 -1
  175. data/lib/rubocop/cop/style/or_assignment.rb +1 -1
  176. data/lib/rubocop/cop/style/percent_q_literals.rb +1 -1
  177. data/lib/rubocop/cop/style/perl_backrefs.rb +2 -2
  178. data/lib/rubocop/cop/style/proc.rb +1 -1
  179. data/lib/rubocop/cop/style/raise_args.rb +1 -1
  180. data/lib/rubocop/cop/style/random_with_offset.rb +3 -3
  181. data/lib/rubocop/cop/style/redundant_condition.rb +18 -6
  182. data/lib/rubocop/cop/style/redundant_conditional.rb +1 -1
  183. data/lib/rubocop/cop/style/redundant_exception.rb +3 -3
  184. data/lib/rubocop/cop/style/redundant_interpolation.rb +2 -2
  185. data/lib/rubocop/cop/style/redundant_parentheses.rb +2 -6
  186. data/lib/rubocop/cop/style/redundant_percent_q.rb +2 -2
  187. data/lib/rubocop/cop/style/redundant_return.rb +5 -7
  188. data/lib/rubocop/cop/style/redundant_self.rb +1 -1
  189. data/lib/rubocop/cop/style/redundant_sort.rb +2 -2
  190. data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
  191. data/lib/rubocop/cop/style/return_nil.rb +1 -1
  192. data/lib/rubocop/cop/style/safe_navigation.rb +3 -7
  193. data/lib/rubocop/cop/style/self_assignment.rb +1 -1
  194. data/lib/rubocop/cop/style/slicing_with_range.rb +39 -0
  195. data/lib/rubocop/cop/style/special_global_vars.rb +3 -7
  196. data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +1 -4
  197. data/lib/rubocop/cop/style/string_hash_keys.rb +1 -1
  198. data/lib/rubocop/cop/style/symbol_array.rb +1 -1
  199. data/lib/rubocop/cop/style/symbol_literal.rb +2 -2
  200. data/lib/rubocop/cop/style/ternary_parentheses.rb +2 -5
  201. data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +35 -0
  202. data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +41 -0
  203. data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +88 -0
  204. data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +44 -0
  205. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +2 -6
  206. data/lib/rubocop/cop/style/trivial_accessors.rb +1 -1
  207. data/lib/rubocop/cop/style/unpack_first.rb +0 -4
  208. data/lib/rubocop/cop/style/variable_interpolation.rb +1 -1
  209. data/lib/rubocop/cop/style/while_until_modifier.rb +1 -1
  210. data/lib/rubocop/cop/style/word_array.rb +1 -1
  211. data/lib/rubocop/cop/style/zero_length_predicate.rb +1 -1
  212. data/lib/rubocop/cop/util.rb +24 -0
  213. data/lib/rubocop/cop/variable_force.rb +3 -9
  214. data/lib/rubocop/cop/variable_force/assignment.rb +1 -0
  215. data/lib/rubocop/cop/variable_force/branch.rb +2 -6
  216. data/lib/rubocop/cop/variable_force/scope.rb +1 -0
  217. data/lib/rubocop/cop/variable_force/variable.rb +3 -6
  218. data/lib/rubocop/ext/processed_source.rb +18 -0
  219. data/lib/rubocop/formatter/base_formatter.rb +0 -4
  220. data/lib/rubocop/formatter/clang_style_formatter.rb +1 -1
  221. data/lib/rubocop/formatter/disabled_config_formatter.rb +4 -12
  222. data/lib/rubocop/formatter/formatter_set.rb +1 -4
  223. data/lib/rubocop/formatter/junit_formatter.rb +17 -6
  224. data/lib/rubocop/formatter/pacman_formatter.rb +1 -1
  225. data/lib/rubocop/formatter/tap_formatter.rb +1 -1
  226. data/lib/rubocop/name_similarity.rb +12 -9
  227. data/lib/rubocop/options.rb +20 -13
  228. data/lib/rubocop/remote_config.rb +1 -3
  229. data/lib/rubocop/result_cache.rb +1 -3
  230. data/lib/rubocop/rspec/cop_helper.rb +2 -4
  231. data/lib/rubocop/rspec/expect_offense.rb +4 -10
  232. data/lib/rubocop/rspec/shared_contexts.rb +54 -20
  233. data/lib/rubocop/runner.rb +15 -12
  234. data/lib/rubocop/target_finder.rb +5 -7
  235. data/lib/rubocop/target_ruby.rb +2 -2
  236. data/lib/rubocop/version.rb +5 -3
  237. metadata +32 -77
  238. data/lib/rubocop/ast/builder.rb +0 -83
  239. data/lib/rubocop/ast/node.rb +0 -632
  240. data/lib/rubocop/ast/node/alias_node.rb +0 -24
  241. data/lib/rubocop/ast/node/and_node.rb +0 -29
  242. data/lib/rubocop/ast/node/args_node.rb +0 -29
  243. data/lib/rubocop/ast/node/array_node.rb +0 -57
  244. data/lib/rubocop/ast/node/block_node.rb +0 -117
  245. data/lib/rubocop/ast/node/break_node.rb +0 -17
  246. data/lib/rubocop/ast/node/case_node.rb +0 -56
  247. data/lib/rubocop/ast/node/class_node.rb +0 -31
  248. data/lib/rubocop/ast/node/def_node.rb +0 -82
  249. data/lib/rubocop/ast/node/defined_node.rb +0 -17
  250. data/lib/rubocop/ast/node/ensure_node.rb +0 -17
  251. data/lib/rubocop/ast/node/float_node.rb +0 -12
  252. data/lib/rubocop/ast/node/for_node.rb +0 -53
  253. data/lib/rubocop/ast/node/forward_args_node.rb +0 -18
  254. data/lib/rubocop/ast/node/hash_node.rb +0 -109
  255. data/lib/rubocop/ast/node/if_node.rb +0 -175
  256. data/lib/rubocop/ast/node/int_node.rb +0 -12
  257. data/lib/rubocop/ast/node/keyword_splat_node.rb +0 -45
  258. data/lib/rubocop/ast/node/mixin/basic_literal_node.rb +0 -16
  259. data/lib/rubocop/ast/node/mixin/binary_operator_node.rb +0 -43
  260. data/lib/rubocop/ast/node/mixin/collection_node.rb +0 -15
  261. data/lib/rubocop/ast/node/mixin/conditional_node.rb +0 -45
  262. data/lib/rubocop/ast/node/mixin/hash_element_node.rb +0 -125
  263. data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +0 -261
  264. data/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb +0 -114
  265. data/lib/rubocop/ast/node/mixin/modifier_node.rb +0 -17
  266. data/lib/rubocop/ast/node/mixin/numeric_node.rb +0 -21
  267. data/lib/rubocop/ast/node/mixin/parameterized_node.rb +0 -61
  268. data/lib/rubocop/ast/node/mixin/predicate_operator_node.rb +0 -35
  269. data/lib/rubocop/ast/node/module_node.rb +0 -24
  270. data/lib/rubocop/ast/node/or_node.rb +0 -29
  271. data/lib/rubocop/ast/node/pair_node.rb +0 -63
  272. data/lib/rubocop/ast/node/range_node.rb +0 -18
  273. data/lib/rubocop/ast/node/regexp_node.rb +0 -33
  274. data/lib/rubocop/ast/node/resbody_node.rb +0 -24
  275. data/lib/rubocop/ast/node/retry_node.rb +0 -17
  276. data/lib/rubocop/ast/node/return_node.rb +0 -24
  277. data/lib/rubocop/ast/node/self_class_node.rb +0 -24
  278. data/lib/rubocop/ast/node/send_node.rb +0 -13
  279. data/lib/rubocop/ast/node/str_node.rb +0 -16
  280. data/lib/rubocop/ast/node/super_node.rb +0 -21
  281. data/lib/rubocop/ast/node/symbol_node.rb +0 -12
  282. data/lib/rubocop/ast/node/until_node.rb +0 -35
  283. data/lib/rubocop/ast/node/when_node.rb +0 -53
  284. data/lib/rubocop/ast/node/while_node.rb +0 -35
  285. data/lib/rubocop/ast/node/yield_node.rb +0 -21
  286. data/lib/rubocop/ast/sexp.rb +0 -16
  287. data/lib/rubocop/ast/traversal.rb +0 -200
  288. data/lib/rubocop/cop/lint/end_in_method.rb +0 -40
  289. data/lib/rubocop/formatter/disabled_lines_formatter.rb +0 -57
  290. data/lib/rubocop/node_pattern.rb +0 -887
  291. data/lib/rubocop/processed_source.rb +0 -216
  292. data/lib/rubocop/string_util.rb +0 -14
  293. data/lib/rubocop/token.rb +0 -114
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7143484124cd6cb7ebff12de736d4ed5a17b5189d26ab6da3f8072cf9b3d6f7e
4
- data.tar.gz: acd2182467726955151e8dc249833ed1fffacae4dc988037ec5fe73e1d5bb0c7
3
+ metadata.gz: 92b169f3f7a5c04a2ce3b9b674328a49e078a8f19b5560e5135eee1ddb4f0428
4
+ data.tar.gz: 6057deda8dd47bbf92038a03ce0bd4d35139c220f5fede6049f5e3da9fcc7ad0
5
5
  SHA512:
6
- metadata.gz: ae462c69bb5933c60f6254c4778fcddf4c778776b1d4c64247091bf36837c6899636d0d79a433c99aa5c64d1c4cccfbb9d1d8531a2b3a8418558899f6be61481
7
- data.tar.gz: 844dd51ef4fef218ab42a742dbd7717b1a47c18b4cee630ba3da77279832292417a8e4c07486b59f821bc7d28ace0cdfaa917f574b1a35fa52bca7fc17da822f
6
+ metadata.gz: 073154f4f62eed603c4b4d947b5dcdc308d1f0aebcffe11daad2b0d21820272f9d13d89e40403292a5497d6d9722e405f9f6cb16071c69214fc10a074eef5254
7
+ data.tar.gz: 69c0e58d557d71c898cf6c43bed3fb6a5df83650e239e470bf0bb56cf4a2722895f2c8b9fb36775e752a2dafc80893f719166e204a4d5f136c82c0f6a03bc321
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
2
2
  [![CircleCI Status](https://circleci.com/gh/rubocop-hq/rubocop/tree/master.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop/tree/master)
3
- [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/sj3ye7n5690d0nvg?svg=true)](https://ci.appveyor.com/project/bbatsov/rubocop)
3
+ [![Actions Status](https://github.com/rubocop-hq/rubocop/workflows/CI/badge.svg?branch=master)](https://github.com/rubocop-hq/rubocop/actions?query=workflow%3ACI)
4
4
  [![Coverage Status](https://api.codeclimate.com/v1/badges/ad6e76460499c8c99697/test_coverage)](https://codeclimate.com/github/bbatsov/rubocop)
5
5
  [![Code Climate](https://codeclimate.com/github/bbatsov/rubocop/badges/gpa.svg)](https://codeclimate.com/github/bbatsov/rubocop)
6
6
  [![Inline docs](https://inch-ci.org/github/bbatsov/rubocop.svg)](https://inch-ci.org/github/bbatsov/rubocop)
@@ -53,7 +53,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
53
53
  might want to use a conservative version lock in your `Gemfile`:
54
54
 
55
55
  ```rb
56
- gem 'rubocop', '~> 0.80.0', require: false
56
+ gem 'rubocop', '~> 0.84.0', require: false
57
57
  ```
58
58
 
59
59
  ## Quickstart
@@ -73,7 +73,7 @@ You can read a lot more about RuboCop in its [official docs](https://docs.ruboco
73
73
 
74
74
  RuboCop supports the following Ruby implementations:
75
75
 
76
- * MRI 2.3+
76
+ * MRI 2.4+
77
77
  * JRuby 9.2+
78
78
 
79
79
  ## Team
@@ -132,7 +132,7 @@ If you're working in a company that's making significant use of RuboCop we'd app
132
132
  to become a RuboCop sponsor.
133
133
 
134
134
  You can support the development of RuboCop via
135
- [Salt](https://salt.bountysource.com/teams/rubocop),
135
+ [GitHub Sponsors](https://github.com/sponsors/bbatsov),
136
136
  [Patreon](https://www.patreon.com/bbatsov),
137
137
  [PayPal](https://paypal.me/bbatsov)
138
138
  and [Open Collective](https://opencollective.com/rubocop).
@@ -35,6 +35,7 @@ AllCops:
35
35
  - '**/*.watchr'
36
36
  - '**/.irbrc'
37
37
  - '**/.pryrc'
38
+ - '**/.simplecov'
38
39
  - '**/buildfile'
39
40
  - '**/Appraisals'
40
41
  - '**/Berksfile'
@@ -53,6 +54,7 @@ AllCops:
53
54
  - '**/Podfile'
54
55
  - '**/Puppetfile'
55
56
  - '**/Rakefile'
57
+ - '**/rakefile'
56
58
  - '**/Snapfile'
57
59
  - '**/Steepfile'
58
60
  - '**/Thorfile'
@@ -97,6 +99,14 @@ AllCops:
97
99
  # to true in the same configuration.
98
100
  EnabledByDefault: false
99
101
  DisabledByDefault: false
102
+ # New cops introduced between major versions are set to a special pending status
103
+ # and are not enabled by default with warning message.
104
+ # Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
105
+ # When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
106
+ # the `--enable-pending-cops` command-line option.
107
+ # When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
108
+ # the `--disable-pending-cops` command-line option.
109
+ NewCops: pending
100
110
  # Enables the result cache if `true`. Can be overridden by the `--cache` command
101
111
  # line option.
102
112
  UseCache: true
@@ -125,7 +135,7 @@ AllCops:
125
135
  # followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
126
136
  # is specified in the Gemfile or gems.rb file, RuboCop reads the final value
127
137
  # from the lock file.) If the Ruby version is still unresolved, RuboCop will
128
- # use the oldest officially supported Ruby version (currently Ruby 2.3).
138
+ # use the oldest officially supported Ruby version (currently Ruby 2.4).
129
139
  TargetRubyVersion: ~
130
140
 
131
141
  #################### Bundler ###############################
@@ -255,10 +265,30 @@ Layout/ArrayAlignment:
255
265
  Description: >-
256
266
  Align the elements of an array literal if they span more than
257
267
  one line.
258
- StyleGuide: '#align-multiline-arrays'
268
+ StyleGuide: '#no-double-indent'
259
269
  Enabled: true
260
270
  VersionAdded: '0.49'
261
271
  VersionChanged: '0.77'
272
+ # Alignment of elements of a multi-line array.
273
+ #
274
+ # The `with_first_parameter` style aligns the following lines along the same
275
+ # column as the first element.
276
+ #
277
+ # array = [1, 2, 3,
278
+ # 4, 5, 6]
279
+ #
280
+ # The `with_fixed_indentation` style aligns the following lines with one
281
+ # level of indentation relative to the start of the line with start of array.
282
+ #
283
+ # array = [1, 2, 3,
284
+ # 4, 5, 6]
285
+ EnforcedStyle: with_first_element
286
+ SupportedStyles:
287
+ - with_first_element
288
+ - with_fixed_indentation
289
+ # By default, the indentation width from Layout/IndentationWidth is used
290
+ # But it can be overridden by setting this parameter
291
+ IndentationWidth: ~
262
292
 
263
293
  Layout/AssignmentIndentation:
264
294
  Description: >-
@@ -347,6 +377,7 @@ Layout/ConditionPosition:
347
377
  StyleGuide: '#same-line-condition'
348
378
  Enabled: true
349
379
  VersionAdded: '0.53'
380
+ VersionChanged: '0.83'
350
381
 
351
382
  Layout/DefEndAlignment:
352
383
  Description: 'Align ends corresponding to defs correctly.'
@@ -432,6 +463,19 @@ Layout/EmptyLinesAroundArguments:
432
463
  Enabled: true
433
464
  VersionAdded: '0.52'
434
465
 
466
+ Layout/EmptyLinesAroundAttributeAccessor:
467
+ Description: "Keep blank lines around attribute accessors."
468
+ StyleGuide: '#empty-lines-around-attribute-accessor'
469
+ Enabled: pending
470
+ VersionAdded: '0.83'
471
+ VersionChanged: '0.84'
472
+ AllowAliasSyntax: true
473
+ AllowedMethods:
474
+ - alias_method
475
+ - public
476
+ - protected
477
+ - private
478
+
435
479
  Layout/EmptyLinesAroundBeginBody:
436
480
  Description: "Keeps track of empty lines around begin-end bodies."
437
481
  StyleGuide: '#empty-lines-around-bodies'
@@ -773,6 +817,22 @@ Layout/IndentationConsistency:
773
817
  # A reference to `EnforcedStyle: indented_internal_methods`.
774
818
  - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
775
819
 
820
+ Layout/IndentationStyle:
821
+ Description: 'Consistent indentation either with tabs only or spaces only.'
822
+ StyleGuide: '#spaces-indentation'
823
+ Enabled: true
824
+ VersionAdded: '0.49'
825
+ VersionChanged: '0.82'
826
+ # By default, the indentation width from Layout/IndentationWidth is used
827
+ # But it can be overridden by setting this parameter
828
+ # It is used during auto-correction to determine how many spaces should
829
+ # replace each tab.
830
+ IndentationWidth: ~
831
+ EnforcedStyle: spaces
832
+ SupportedStyles:
833
+ - spaces
834
+ - tabs
835
+
776
836
  Layout/IndentationWidth:
777
837
  Description: 'Use 2 spaces for indentation.'
778
838
  StyleGuide: '#spaces-indentation'
@@ -808,9 +868,9 @@ Layout/LineLength:
808
868
  StyleGuide: '#80-character-limits'
809
869
  Enabled: true
810
870
  VersionAdded: '0.25'
811
- VersionChanged: '0.78'
871
+ VersionChanged: '0.84'
812
872
  AutoCorrect: false
813
- Max: 80
873
+ Max: 120
814
874
  # To make it possible to copy or click on URIs in the code, we allow lines
815
875
  # containing a URI to be longer than Max.
816
876
  AllowHeredoc: true
@@ -1060,6 +1120,11 @@ Layout/SpaceAroundKeyword:
1060
1120
  Enabled: true
1061
1121
  VersionAdded: '0.49'
1062
1122
 
1123
+ Layout/SpaceAroundMethodCallOperator:
1124
+ Description: 'Checks method call operators to not have spaces around them.'
1125
+ Enabled: pending
1126
+ VersionAdded: '0.82'
1127
+
1063
1128
  Layout/SpaceAroundOperators:
1064
1129
  Description: 'Use a single space around operators.'
1065
1130
  StyleGuide: '#spaces-operators'
@@ -1230,18 +1295,6 @@ Layout/SpaceInsideStringInterpolation:
1230
1295
  - space
1231
1296
  - no_space
1232
1297
 
1233
- Layout/Tab:
1234
- Description: 'No hard tabs.'
1235
- StyleGuide: '#spaces-indentation'
1236
- Enabled: true
1237
- VersionAdded: '0.49'
1238
- VersionChanged: '0.51'
1239
- # By default, the indentation width from Layout/IndentationWidth is used
1240
- # But it can be overridden by setting this parameter
1241
- # It is used during auto-correction to determine how many spaces should
1242
- # replace each tab.
1243
- IndentationWidth: ~
1244
-
1245
1298
  Layout/TrailingEmptyLines:
1246
1299
  Description: 'Checks trailing blank lines and final newline.'
1247
1300
  StyleGuide: '#newline-eof'
@@ -1258,8 +1311,8 @@ Layout/TrailingWhitespace:
1258
1311
  StyleGuide: '#no-trailing-whitespace'
1259
1312
  Enabled: true
1260
1313
  VersionAdded: '0.49'
1261
- VersionChanged: '0.55'
1262
- AllowInHeredoc: false
1314
+ VersionChanged: '0.83'
1315
+ AllowInHeredoc: true
1263
1316
 
1264
1317
  #################### Lint ##################################
1265
1318
  ### Warnings
@@ -1279,6 +1332,7 @@ Lint/AmbiguousOperator:
1279
1332
  StyleGuide: '#method-invocation-parens'
1280
1333
  Enabled: true
1281
1334
  VersionAdded: '0.17'
1335
+ VersionChanged: '0.83'
1282
1336
 
1283
1337
  Lint/AmbiguousRegexpLiteral:
1284
1338
  Description: >-
@@ -1286,6 +1340,7 @@ Lint/AmbiguousRegexpLiteral:
1286
1340
  a method invocation without parentheses.
1287
1341
  Enabled: true
1288
1342
  VersionAdded: '0.17'
1343
+ VersionChanged: '0.83'
1289
1344
 
1290
1345
  Lint/AssignmentInCondition:
1291
1346
  Description: "Don't use assignment in conditions."
@@ -1302,7 +1357,9 @@ Lint/BigDecimalNew:
1302
1357
  Lint/BooleanSymbol:
1303
1358
  Description: 'Check for `:true` and `:false` symbols.'
1304
1359
  Enabled: true
1360
+ Safe: false
1305
1361
  VersionAdded: '0.50'
1362
+ VersionChanged: '0.83'
1306
1363
 
1307
1364
  Lint/CircularArgumentReference:
1308
1365
  Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
@@ -1320,6 +1377,11 @@ Lint/DeprecatedClassMethods:
1320
1377
  Enabled: true
1321
1378
  VersionAdded: '0.19'
1322
1379
 
1380
+ Lint/DeprecatedOpenSSLConstant:
1381
+ Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
1382
+ Enabled: pending
1383
+ VersionAdded: '0.84'
1384
+
1323
1385
  Lint/DisjunctiveAssignmentInConstructor:
1324
1386
  Description: 'In constructor, plain assignment is preferred over disjunctive.'
1325
1387
  Enabled: true
@@ -1373,18 +1435,16 @@ Lint/EmptyInterpolation:
1373
1435
  Lint/EmptyWhen:
1374
1436
  Description: 'Checks for `when` branches with empty bodies.'
1375
1437
  Enabled: true
1438
+ AllowComments: true
1376
1439
  VersionAdded: '0.45'
1377
-
1378
- Lint/EndInMethod:
1379
- Description: 'END blocks should not be placed inside method definitions.'
1380
- Enabled: true
1381
- VersionAdded: '0.9'
1440
+ VersionChanged: '0.83'
1382
1441
 
1383
1442
  Lint/EnsureReturn:
1384
1443
  Description: 'Do not use return in an ensure block.'
1385
1444
  StyleGuide: '#no-return-ensure'
1386
1445
  Enabled: true
1387
1446
  VersionAdded: '0.9'
1447
+ VersionChanged: '0.83'
1388
1448
 
1389
1449
  Lint/ErbNewArguments:
1390
1450
  Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
@@ -1532,6 +1592,7 @@ Lint/ParenthesesAsGroupedExpression:
1532
1592
  StyleGuide: '#parens-no-spaces'
1533
1593
  Enabled: true
1534
1594
  VersionAdded: '0.12'
1595
+ VersionChanged: '0.83'
1535
1596
 
1536
1597
  Lint/PercentStringArray:
1537
1598
  Description: >-
@@ -1546,6 +1607,14 @@ Lint/PercentSymbolArray:
1546
1607
  Enabled: true
1547
1608
  VersionAdded: '0.41'
1548
1609
 
1610
+ Lint/RaiseException:
1611
+ Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
1612
+ StyleGuide: '#raise-exception'
1613
+ Enabled: pending
1614
+ VersionAdded: '0.81'
1615
+ AllowedImplicitNamespaces:
1616
+ - 'Gem'
1617
+
1549
1618
  Lint/RandOne:
1550
1619
  Description: >-
1551
1620
  Checks for `rand(1)` calls. Such calls always return `0`
@@ -1574,7 +1643,7 @@ Lint/RedundantRequireStatement:
1574
1643
  Lint/RedundantSplatExpansion:
1575
1644
  Description: 'Checks for splat unnecessarily being called on literals.'
1576
1645
  Enabled: true
1577
- VersionChanged: '0.76'
1646
+ VersionAdded: '0.76'
1578
1647
 
1579
1648
  Lint/RedundantStringCoercion:
1580
1649
  Description: 'Checks for Object#to_s usage in string interpolation.'
@@ -1688,13 +1757,18 @@ Lint/ShadowingOuterLocalVariable:
1688
1757
  Enabled: true
1689
1758
  VersionAdded: '0.9'
1690
1759
 
1760
+ Lint/StructNewOverride:
1761
+ Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
1762
+ Enabled: pending
1763
+ VersionAdded: '0.81'
1764
+
1691
1765
  Lint/SuppressedException:
1692
1766
  Description: "Don't suppress exceptions."
1693
1767
  StyleGuide: '#dont-hide-exceptions'
1694
1768
  Enabled: true
1695
- AllowComments: false
1769
+ AllowComments: true
1696
1770
  VersionAdded: '0.9'
1697
- VersionChanged: '0.77'
1771
+ VersionChanged: '0.81'
1698
1772
 
1699
1773
  Lint/Syntax:
1700
1774
  Description: 'Checks syntax error.'
@@ -1705,6 +1779,7 @@ Lint/Syntax:
1705
1779
  Lint/ToJSON:
1706
1780
  Description: 'Ensure #to_json includes an optional argument.'
1707
1781
  Enabled: true
1782
+ VersionAdded: '0.66'
1708
1783
 
1709
1784
  Lint/UnderscorePrefixedVariableName:
1710
1785
  Description: 'Do not use prefix `_` for a variable that is used.'
@@ -1736,9 +1811,10 @@ Lint/UnusedMethodArgument:
1736
1811
  StyleGuide: '#underscore-unused-vars'
1737
1812
  Enabled: true
1738
1813
  VersionAdded: '0.21'
1739
- VersionChanged: '0.35'
1814
+ VersionChanged: '0.81'
1740
1815
  AllowUnusedKeywordArguments: false
1741
1816
  IgnoreEmptyMethods: true
1817
+ IgnoreNotImplementedMethods: true
1742
1818
 
1743
1819
  Lint/UriEscapeUnescape:
1744
1820
  Description: >-
@@ -1760,7 +1836,7 @@ Lint/UselessAccessModifier:
1760
1836
  Description: 'Checks for useless access modifiers.'
1761
1837
  Enabled: true
1762
1838
  VersionAdded: '0.20'
1763
- VersionChanged: '0.47'
1839
+ VersionChanged: '0.83'
1764
1840
  ContextCreatingMethods: []
1765
1841
  MethodCreatingMethods: []
1766
1842
 
@@ -1804,9 +1880,10 @@ Metrics/AbcSize:
1804
1880
  - https://en.wikipedia.org/wiki/ABC_Software_Metric
1805
1881
  Enabled: true
1806
1882
  VersionAdded: '0.27'
1807
- VersionChanged: '0.66'
1883
+ VersionChanged: '0.81'
1808
1884
  # The ABC size is a calculated magnitude, so this number can be an Integer or
1809
1885
  # a Float.
1886
+ IgnoredMethods: []
1810
1887
  Max: 15
1811
1888
 
1812
1889
  Metrics/BlockLength:
@@ -1846,6 +1923,8 @@ Metrics/CyclomaticComplexity:
1846
1923
  of test cases needed to validate a method.
1847
1924
  Enabled: true
1848
1925
  VersionAdded: '0.25'
1926
+ VersionChanged: '0.81'
1927
+ IgnoredMethods: []
1849
1928
  Max: 6
1850
1929
 
1851
1930
  Metrics/MethodLength:
@@ -1879,6 +1958,8 @@ Metrics/PerceivedComplexity:
1879
1958
  human reader.
1880
1959
  Enabled: true
1881
1960
  VersionAdded: '0.25'
1961
+ VersionChanged: '0.81'
1962
+ IgnoredMethods: []
1882
1963
  Max: 7
1883
1964
 
1884
1965
  ################## Migration #############################
@@ -1888,6 +1969,7 @@ Migration/DepartmentName:
1888
1969
  Check that cop names in rubocop:disable (etc) comments are
1889
1970
  given with department name.
1890
1971
  Enabled: true
1972
+ VersionAdded: '0.75'
1891
1973
 
1892
1974
  #################### Naming ##############################
1893
1975
 
@@ -2178,10 +2260,12 @@ Style/AccessModifierDeclarations:
2178
2260
  Description: 'Checks style of how access modifiers are used.'
2179
2261
  Enabled: true
2180
2262
  VersionAdded: '0.57'
2263
+ VersionChanged: '0.81'
2181
2264
  EnforcedStyle: group
2182
2265
  SupportedStyles:
2183
2266
  - inline
2184
2267
  - group
2268
+ AllowModifiersOnSymbols: true
2185
2269
 
2186
2270
  Style/Alias:
2187
2271
  Description: 'Use alias instead of alias_method.'
@@ -2202,7 +2286,7 @@ Style/AndOr:
2202
2286
  VersionChanged: '0.25'
2203
2287
  # Whether `and` and `or` are banned only in conditionals (conditionals)
2204
2288
  # or completely (always).
2205
- EnforcedStyle: always
2289
+ EnforcedStyle: conditionals
2206
2290
  SupportedStyles:
2207
2291
  - always
2208
2292
  - conditionals
@@ -2372,6 +2456,15 @@ Style/CaseEquality:
2372
2456
  StyleGuide: '#no-case-equality'
2373
2457
  Enabled: true
2374
2458
  VersionAdded: '0.9'
2459
+ # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
2460
+ # the case equality operator is a constant.
2461
+ #
2462
+ # # bad
2463
+ # /string/ === "string"
2464
+ #
2465
+ # # good
2466
+ # String === "string"
2467
+ AllowOnConstant: false
2375
2468
 
2376
2469
  Style/CharacterLiteral:
2377
2470
  Description: 'Checks for uses of character literals.'
@@ -2412,6 +2505,7 @@ Style/ClassAndModuleChildren:
2412
2505
 
2413
2506
  Style/ClassCheck:
2414
2507
  Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
2508
+ StyleGuide: '#is-a-vs-kind-of'
2415
2509
  Enabled: true
2416
2510
  VersionAdded: '0.24'
2417
2511
  EnforcedStyle: is_a?
@@ -2435,7 +2529,7 @@ Style/ClassVars:
2435
2529
  # Align with the style guide.
2436
2530
  Style/CollectionMethods:
2437
2531
  Description: 'Preferred collection methods.'
2438
- StyleGuide: '#map-find-select-reduce-size'
2532
+ StyleGuide: '#map-find-select-reduce-include-size'
2439
2533
  Enabled: false
2440
2534
  VersionAdded: '0.9'
2441
2535
  VersionChanged: '0.27'
@@ -2452,6 +2546,7 @@ Style/CollectionMethods:
2452
2546
  inject: 'reduce'
2453
2547
  detect: 'find'
2454
2548
  find_all: 'select'
2549
+ member?: 'include?'
2455
2550
 
2456
2551
  Style/ColonMethodCall:
2457
2552
  Description: 'Do not use :: for method call.'
@@ -2578,6 +2673,12 @@ Style/Dir:
2578
2673
  Enabled: true
2579
2674
  VersionAdded: '0.50'
2580
2675
 
2676
+ Style/DisableCopsWithinSourceCodeDirective:
2677
+ Description: >-
2678
+ Forbids disabling/enabling cops within source code.
2679
+ Enabled: false
2680
+ VersionAdded: '0.82'
2681
+
2581
2682
  Style/Documentation:
2582
2683
  Description: 'Document classes and non-namespace modules.'
2583
2684
  Enabled: true
@@ -2605,6 +2706,11 @@ Style/DoubleNegation:
2605
2706
  StyleGuide: '#no-bang-bang'
2606
2707
  Enabled: true
2607
2708
  VersionAdded: '0.19'
2709
+ VersionChanged: '0.84'
2710
+ EnforcedStyle: allowed_in_returns
2711
+ SupportedStyles:
2712
+ - allowed_in_returns
2713
+ - forbidden
2608
2714
 
2609
2715
  Style/EachForSimpleLoop:
2610
2716
  Description: >-
@@ -2677,6 +2783,7 @@ Style/EndBlock:
2677
2783
  StyleGuide: '#no-END-blocks'
2678
2784
  Enabled: true
2679
2785
  VersionAdded: '0.9'
2786
+ VersionChanged: '0.81'
2680
2787
 
2681
2788
  Style/EvalWithLocation:
2682
2789
  Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
@@ -2695,6 +2802,17 @@ Style/ExpandPathArguments:
2695
2802
  Enabled: true
2696
2803
  VersionAdded: '0.53'
2697
2804
 
2805
+ Style/ExponentialNotation:
2806
+ Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
2807
+ StyleGuide: '#exponential-notation'
2808
+ Enabled: pending
2809
+ VersionAdded: '0.82'
2810
+ EnforcedStyle: scientific
2811
+ SupportedStyles:
2812
+ - scientific
2813
+ - engineering
2814
+ - integral
2815
+
2698
2816
  Style/FloatDivision:
2699
2817
  Description: 'For performing float division, coerce one side only.'
2700
2818
  StyleGuide: '#float-division'
@@ -2820,11 +2938,13 @@ Style/HashSyntax:
2820
2938
  Style/HashTransformKeys:
2821
2939
  Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
2822
2940
  Enabled: 'pending'
2941
+ VersionAdded: '0.80'
2823
2942
  Safe: false
2824
2943
 
2825
2944
  Style/HashTransformValues:
2826
2945
  Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
2827
2946
  Enabled: 'pending'
2947
+ VersionAdded: '0.80'
2828
2948
  Safe: false
2829
2949
 
2830
2950
  Style/IdenticalConditionalBranches:
@@ -2861,6 +2981,7 @@ Style/IfWithSemicolon:
2861
2981
  StyleGuide: '#no-semicolon-ifs'
2862
2982
  Enabled: true
2863
2983
  VersionAdded: '0.9'
2984
+ VersionChanged: '0.83'
2864
2985
 
2865
2986
  Style/ImplicitRuntimeError:
2866
2987
  Description: >-
@@ -2935,7 +3056,7 @@ Style/LambdaCall:
2935
3056
  Description: 'Use lambda.call(...) instead of lambda.(...).'
2936
3057
  StyleGuide: '#proc-call'
2937
3058
  Enabled: true
2938
- VersionAdded: '0.13.1'
3059
+ VersionAdded: '0.13'
2939
3060
  VersionChanged: '0.14'
2940
3061
  EnforcedStyle: call
2941
3062
  SupportedStyles:
@@ -3065,6 +3186,7 @@ Style/ModuleFunction:
3065
3186
  SupportedStyles:
3066
3187
  - module_function
3067
3188
  - extend_self
3189
+ - forbidden
3068
3190
  Autocorrect: false
3069
3191
  SafeAutoCorrect: false
3070
3192
 
@@ -3337,7 +3459,9 @@ Style/OptionalArguments:
3337
3459
  of the argument list.
3338
3460
  StyleGuide: '#optional-arguments'
3339
3461
  Enabled: true
3462
+ Safe: false
3340
3463
  VersionAdded: '0.33'
3464
+ VersionChanged: '0.83'
3341
3465
 
3342
3466
  Style/OrAssignment:
3343
3467
  Description: 'Recommend usage of double pipe equals (||=) where applicable.'
@@ -3642,6 +3766,12 @@ Style/SingleLineMethods:
3642
3766
  VersionChanged: '0.19'
3643
3767
  AllowIfMethodIsEmpty: true
3644
3768
 
3769
+ Style/SlicingWithRange:
3770
+ Description: 'Checks array slicing is done with endless ranges when suitable.'
3771
+ Enabled: pending
3772
+ VersionAdded: '0.83'
3773
+ Safe: false
3774
+
3645
3775
  Style/SpecialGlobalVars:
3646
3776
  Description: 'Avoid Perl-style global variables.'
3647
3777
  StyleGuide: '#no-cryptic-perlisms'
@@ -3804,22 +3934,29 @@ Style/TrailingCommaInArrayLiteral:
3804
3934
  StyleGuide: '#no-trailing-array-commas'
3805
3935
  Enabled: true
3806
3936
  VersionAdded: '0.53'
3937
+ # If `comma`, the cop requires a comma after the last item in an array,
3807
3938
  # but only when each item is on its own line.
3808
3939
  # If `consistent_comma`, the cop requires a comma after the last item of all
3809
- # non-empty array literals.
3940
+ # non-empty, multiline array literals.
3810
3941
  EnforcedStyleForMultiline: no_comma
3811
3942
  SupportedStylesForMultiline:
3812
3943
  - comma
3813
3944
  - consistent_comma
3814
3945
  - no_comma
3815
3946
 
3947
+ Style/TrailingCommaInBlockArgs:
3948
+ Description: 'Checks for useless trailing commas in block arguments.'
3949
+ Enabled: false
3950
+ Safe: false
3951
+ VersionAdded: '0.81'
3952
+
3816
3953
  Style/TrailingCommaInHashLiteral:
3817
3954
  Description: 'Checks for trailing comma in hash literals.'
3818
3955
  Enabled: true
3819
3956
  # If `comma`, the cop requires a comma after the last item in a hash,
3820
3957
  # but only when each item is on its own line.
3821
3958
  # If `consistent_comma`, the cop requires a comma after the last item of all
3822
- # non-empty hash literals.
3959
+ # non-empty, multiline hash literals.
3823
3960
  EnforcedStyleForMultiline: no_comma
3824
3961
  SupportedStylesForMultiline:
3825
3962
  - comma