rubocop 0.35.1 → 0.36.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubocop might be problematic. Click here for more details.

Files changed (385) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +164 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +72 -21
  5. data/bin/rubocop +1 -0
  6. data/config/default.yml +167 -18
  7. data/config/disabled.yml +19 -6
  8. data/config/enabled.yml +159 -14
  9. data/lib/rubocop.rb +67 -26
  10. data/lib/rubocop/ast_node.rb +488 -14
  11. data/lib/rubocop/ast_node/builder.rb +24 -0
  12. data/lib/rubocop/ast_node/sexp.rb +13 -0
  13. data/lib/rubocop/cached_data.rb +58 -0
  14. data/lib/rubocop/cli.rb +47 -10
  15. data/lib/rubocop/comment_config.rb +9 -2
  16. data/lib/rubocop/config.rb +99 -31
  17. data/lib/rubocop/config_loader.rb +23 -14
  18. data/lib/rubocop/config_store.rb +1 -0
  19. data/lib/rubocop/cop/autocorrect_logic.rb +2 -1
  20. data/lib/rubocop/cop/commissioner.rb +3 -5
  21. data/lib/rubocop/cop/cop.rb +23 -17
  22. data/lib/rubocop/cop/corrector.rb +25 -0
  23. data/lib/rubocop/cop/force.rb +1 -0
  24. data/lib/rubocop/cop/ignored_node.rb +3 -2
  25. data/lib/rubocop/cop/lint/ambiguous_operator.rb +2 -1
  26. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +2 -1
  27. data/lib/rubocop/cop/lint/assignment_in_condition.rb +4 -3
  28. data/lib/rubocop/cop/lint/block_alignment.rb +29 -91
  29. data/lib/rubocop/cop/lint/circular_argument_reference.rb +2 -1
  30. data/lib/rubocop/cop/lint/condition_position.rb +2 -1
  31. data/lib/rubocop/cop/lint/debugger.rb +29 -12
  32. data/lib/rubocop/cop/lint/def_end_alignment.rb +16 -18
  33. data/lib/rubocop/cop/lint/deprecated_class_methods.rb +6 -6
  34. data/lib/rubocop/cop/lint/duplicate_methods.rb +98 -74
  35. data/lib/rubocop/cop/lint/duplicated_key.rb +3 -2
  36. data/lib/rubocop/cop/lint/each_with_object_argument.rb +3 -2
  37. data/lib/rubocop/cop/lint/else_layout.rb +2 -1
  38. data/lib/rubocop/cop/lint/empty_ensure.rb +2 -1
  39. data/lib/rubocop/cop/lint/empty_interpolation.rb +2 -1
  40. data/lib/rubocop/cop/lint/end_alignment.rb +77 -39
  41. data/lib/rubocop/cop/lint/end_in_method.rb +2 -1
  42. data/lib/rubocop/cop/lint/ensure_return.rb +2 -1
  43. data/lib/rubocop/cop/lint/eval.rb +2 -1
  44. data/lib/rubocop/cop/lint/float_out_of_range.rb +31 -0
  45. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +14 -30
  46. data/lib/rubocop/cop/lint/handle_exceptions.rb +2 -1
  47. data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +85 -0
  48. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +120 -0
  49. data/lib/rubocop/cop/lint/invalid_character_literal.rb +3 -1
  50. data/lib/rubocop/cop/lint/literal_in_condition.rb +6 -9
  51. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +6 -9
  52. data/lib/rubocop/cop/lint/loop.rb +2 -1
  53. data/lib/rubocop/cop/lint/nested_method_definition.rb +19 -3
  54. data/lib/rubocop/cop/lint/next_without_accumulator.rb +38 -0
  55. data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +5 -8
  56. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +8 -6
  57. data/lib/rubocop/cop/lint/rand_one.rb +36 -0
  58. data/lib/rubocop/cop/lint/require_parentheses.rb +6 -5
  59. data/lib/rubocop/cop/lint/rescue_exception.rb +3 -2
  60. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +2 -1
  61. data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +6 -4
  62. data/lib/rubocop/cop/lint/syntax.rb +9 -5
  63. data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +3 -2
  64. data/lib/rubocop/cop/lint/unneeded_disable.rb +121 -18
  65. data/lib/rubocop/cop/lint/unreachable_code.rb +5 -4
  66. data/lib/rubocop/cop/lint/unused_block_argument.rb +9 -7
  67. data/lib/rubocop/cop/lint/unused_method_argument.rb +2 -1
  68. data/lib/rubocop/cop/lint/useless_access_modifier.rb +56 -29
  69. data/lib/rubocop/cop/lint/useless_assignment.rb +4 -16
  70. data/lib/rubocop/cop/lint/useless_comparison.rb +3 -2
  71. data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +2 -1
  72. data/lib/rubocop/cop/lint/useless_setter_call.rb +14 -20
  73. data/lib/rubocop/cop/lint/void.rb +10 -11
  74. data/lib/rubocop/cop/metrics/abc_size.rb +3 -1
  75. data/lib/rubocop/cop/metrics/block_nesting.rb +2 -1
  76. data/lib/rubocop/cop/metrics/class_length.rb +1 -0
  77. data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +4 -2
  78. data/lib/rubocop/cop/metrics/line_length.rb +35 -13
  79. data/lib/rubocop/cop/metrics/method_length.rb +2 -1
  80. data/lib/rubocop/cop/metrics/module_length.rb +1 -0
  81. data/lib/rubocop/cop/metrics/parameter_lists.rb +2 -1
  82. data/lib/rubocop/cop/metrics/perceived_complexity.rb +4 -2
  83. data/lib/rubocop/cop/mixin/access_modifier_node.rb +3 -10
  84. data/lib/rubocop/cop/mixin/annotation_comment.rb +1 -0
  85. data/lib/rubocop/cop/mixin/array_hash_indentation.rb +80 -0
  86. data/lib/rubocop/cop/mixin/array_syntax.rb +2 -1
  87. data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +14 -20
  88. data/lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb +5 -4
  89. data/lib/rubocop/cop/mixin/check_assignment.rb +20 -15
  90. data/lib/rubocop/cop/mixin/classish_length.rb +1 -0
  91. data/lib/rubocop/cop/mixin/code_length.rb +1 -0
  92. data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +17 -15
  93. data/lib/rubocop/cop/mixin/configurable_max.rb +1 -0
  94. data/lib/rubocop/cop/mixin/configurable_naming.rb +4 -0
  95. data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +9 -4
  96. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +24 -16
  97. data/lib/rubocop/cop/mixin/first_element_line_break.rb +3 -2
  98. data/lib/rubocop/cop/mixin/hash_node.rb +15 -0
  99. data/lib/rubocop/cop/mixin/if_node.rb +1 -0
  100. data/lib/rubocop/cop/mixin/method_complexity.rb +1 -0
  101. data/lib/rubocop/cop/mixin/method_preference.rb +1 -0
  102. data/lib/rubocop/cop/mixin/min_body_length.rb +1 -0
  103. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +177 -0
  104. data/lib/rubocop/cop/mixin/negative_conditional.rb +1 -0
  105. data/lib/rubocop/cop/mixin/on_method_def.rb +6 -5
  106. data/lib/rubocop/cop/mixin/on_normal_if_unless.rb +1 -0
  107. data/lib/rubocop/cop/mixin/parentheses.rb +22 -0
  108. data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -0
  109. data/lib/rubocop/cop/mixin/percent_literal.rb +1 -0
  110. data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +79 -0
  111. data/lib/rubocop/cop/mixin/safe_assignment.rb +1 -0
  112. data/lib/rubocop/cop/mixin/space_after_punctuation.rb +2 -1
  113. data/lib/rubocop/cop/mixin/space_before_punctuation.rb +2 -1
  114. data/lib/rubocop/cop/mixin/space_inside.rb +2 -1
  115. data/lib/rubocop/cop/mixin/statement_modifier.rb +6 -5
  116. data/lib/rubocop/cop/mixin/string_help.rb +2 -9
  117. data/lib/rubocop/cop/mixin/string_literals_help.rb +13 -7
  118. data/lib/rubocop/cop/mixin/surrounding_space.rb +3 -2
  119. data/lib/rubocop/cop/mixin/trailing_comma.rb +134 -0
  120. data/lib/rubocop/cop/mixin/unused_argument.rb +1 -0
  121. data/lib/rubocop/cop/offense.rb +19 -14
  122. data/lib/rubocop/cop/performance/case_when_splat.rb +8 -8
  123. data/lib/rubocop/cop/performance/casecmp.rb +54 -0
  124. data/lib/rubocop/cop/performance/count.rb +10 -9
  125. data/lib/rubocop/cop/performance/detect.rb +6 -5
  126. data/lib/rubocop/cop/performance/double_start_end_with.rb +65 -0
  127. data/lib/rubocop/cop/performance/end_with.rb +55 -0
  128. data/lib/rubocop/cop/performance/fixed_size.rb +1 -0
  129. data/lib/rubocop/cop/performance/flat_map.rb +9 -8
  130. data/lib/rubocop/cop/performance/hash_each.rb +86 -0
  131. data/lib/rubocop/cop/performance/lstrip_rstrip.rb +44 -0
  132. data/lib/rubocop/cop/performance/range_include.rb +40 -0
  133. data/lib/rubocop/cop/performance/redundant_block_call.rb +57 -0
  134. data/lib/rubocop/cop/performance/redundant_match.rb +51 -0
  135. data/lib/rubocop/cop/performance/redundant_merge.rb +85 -0
  136. data/lib/rubocop/cop/performance/redundant_sort_by.rb +45 -0
  137. data/lib/rubocop/cop/performance/reverse_each.rb +3 -2
  138. data/lib/rubocop/cop/performance/sample.rb +6 -5
  139. data/lib/rubocop/cop/performance/size.rb +2 -1
  140. data/lib/rubocop/cop/performance/start_with.rb +58 -0
  141. data/lib/rubocop/cop/performance/string_replacement.rb +18 -23
  142. data/lib/rubocop/cop/performance/times_map.rb +49 -0
  143. data/lib/rubocop/cop/rails/action_filter.rb +4 -3
  144. data/lib/rubocop/cop/rails/date.rb +5 -4
  145. data/lib/rubocop/cop/rails/delegate.rb +3 -2
  146. data/lib/rubocop/cop/rails/find_by.rb +20 -14
  147. data/lib/rubocop/cop/rails/find_each.rb +23 -2
  148. data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +3 -2
  149. data/lib/rubocop/cop/rails/output.rb +4 -2
  150. data/lib/rubocop/cop/rails/pluralization_grammar.rb +3 -2
  151. data/lib/rubocop/cop/rails/read_write_attribute.rb +5 -7
  152. data/lib/rubocop/cop/rails/scope_args.rb +3 -2
  153. data/lib/rubocop/cop/rails/time_zone.rb +14 -10
  154. data/lib/rubocop/cop/rails/validation.rb +4 -3
  155. data/lib/rubocop/cop/severity.rb +8 -7
  156. data/lib/rubocop/cop/style/access_modifier_indentation.rb +5 -4
  157. data/lib/rubocop/cop/style/accessor_method_name.rb +1 -0
  158. data/lib/rubocop/cop/style/alias.rb +84 -24
  159. data/lib/rubocop/cop/style/align_array.rb +2 -1
  160. data/lib/rubocop/cop/style/align_hash.rb +13 -14
  161. data/lib/rubocop/cop/style/align_parameters.rb +3 -2
  162. data/lib/rubocop/cop/style/and_or.rb +9 -7
  163. data/lib/rubocop/cop/style/array_join.rb +5 -5
  164. data/lib/rubocop/cop/style/ascii_comments.rb +2 -1
  165. data/lib/rubocop/cop/style/ascii_identifiers.rb +2 -1
  166. data/lib/rubocop/cop/style/attr.rb +30 -5
  167. data/lib/rubocop/cop/style/auto_resource_cleanup.rb +3 -3
  168. data/lib/rubocop/cop/style/bare_percent_literals.rb +2 -1
  169. data/lib/rubocop/cop/style/begin_block.rb +2 -1
  170. data/lib/rubocop/cop/style/block_comments.rb +2 -1
  171. data/lib/rubocop/cop/style/block_delimiters.rb +10 -9
  172. data/lib/rubocop/cop/style/block_end_newline.rb +3 -2
  173. data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +9 -8
  174. data/lib/rubocop/cop/style/case_equality.rb +2 -1
  175. data/lib/rubocop/cop/style/case_indentation.rb +2 -1
  176. data/lib/rubocop/cop/style/character_literal.rb +11 -7
  177. data/lib/rubocop/cop/style/class_and_module_camel_case.rb +2 -1
  178. data/lib/rubocop/cop/style/class_and_module_children.rb +3 -2
  179. data/lib/rubocop/cop/style/class_check.rb +2 -1
  180. data/lib/rubocop/cop/style/class_methods.rb +2 -1
  181. data/lib/rubocop/cop/style/class_vars.rb +2 -1
  182. data/lib/rubocop/cop/style/closing_parenthesis_indentation.rb +3 -2
  183. data/lib/rubocop/cop/style/collection_methods.rb +2 -1
  184. data/lib/rubocop/cop/style/colon_method_call.rb +3 -2
  185. data/lib/rubocop/cop/style/command_literal.rb +8 -7
  186. data/lib/rubocop/cop/style/comment_annotation.rb +3 -2
  187. data/lib/rubocop/cop/style/comment_indentation.rb +4 -6
  188. data/lib/rubocop/cop/style/conditional_assignment.rb +362 -0
  189. data/lib/rubocop/cop/style/constant_name.rb +2 -1
  190. data/lib/rubocop/cop/style/copyright.rb +7 -6
  191. data/lib/rubocop/cop/style/def_with_parentheses.rb +2 -1
  192. data/lib/rubocop/cop/style/deprecated_hash_methods.rb +3 -2
  193. data/lib/rubocop/cop/style/documentation.rb +7 -11
  194. data/lib/rubocop/cop/style/dot_position.rb +3 -2
  195. data/lib/rubocop/cop/style/double_negation.rb +2 -1
  196. data/lib/rubocop/cop/style/each_with_object.rb +4 -3
  197. data/lib/rubocop/cop/style/else_alignment.rb +3 -2
  198. data/lib/rubocop/cop/style/empty_else.rb +4 -3
  199. data/lib/rubocop/cop/style/empty_line_between_defs.rb +2 -1
  200. data/lib/rubocop/cop/style/empty_lines.rb +10 -4
  201. data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +13 -5
  202. data/lib/rubocop/cop/style/empty_lines_around_block_body.rb +7 -3
  203. data/lib/rubocop/cop/style/empty_lines_around_class_body.rb +6 -3
  204. data/lib/rubocop/cop/style/empty_lines_around_method_body.rb +4 -3
  205. data/lib/rubocop/cop/style/empty_lines_around_module_body.rb +4 -2
  206. data/lib/rubocop/cop/style/empty_literal.rb +20 -5
  207. data/lib/rubocop/cop/style/encoding.rb +8 -11
  208. data/lib/rubocop/cop/style/end_block.rb +3 -1
  209. data/lib/rubocop/cop/style/end_of_line.rb +2 -1
  210. data/lib/rubocop/cop/style/even_odd.rb +4 -3
  211. data/lib/rubocop/cop/style/extra_spacing.rb +110 -74
  212. data/lib/rubocop/cop/style/file_name.rb +103 -6
  213. data/lib/rubocop/cop/style/first_array_element_line_break.rb +3 -2
  214. data/lib/rubocop/cop/style/first_hash_element_line_break.rb +5 -6
  215. data/lib/rubocop/cop/style/first_method_argument_line_break.rb +14 -1
  216. data/lib/rubocop/cop/style/first_method_parameter_line_break.rb +2 -1
  217. data/lib/rubocop/cop/style/first_parameter_indentation.rb +6 -4
  218. data/lib/rubocop/cop/style/flip_flop.rb +2 -1
  219. data/lib/rubocop/cop/style/for.rb +2 -1
  220. data/lib/rubocop/cop/style/format_string.rb +1 -0
  221. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +89 -0
  222. data/lib/rubocop/cop/style/global_vars.rb +2 -1
  223. data/lib/rubocop/cop/style/guard_clause.rb +63 -11
  224. data/lib/rubocop/cop/style/hash_syntax.rb +10 -10
  225. data/lib/rubocop/cop/style/identical_conditional_branches.rb +93 -0
  226. data/lib/rubocop/cop/style/if_inside_else.rb +49 -0
  227. data/lib/rubocop/cop/style/if_unless_modifier.rb +6 -5
  228. data/lib/rubocop/cop/style/if_with_semicolon.rb +2 -1
  229. data/lib/rubocop/cop/style/indent_array.rb +89 -38
  230. data/lib/rubocop/cop/style/indent_assignment.rb +43 -0
  231. data/lib/rubocop/cop/style/indent_hash.rb +16 -77
  232. data/lib/rubocop/cop/style/indentation_consistency.rb +2 -1
  233. data/lib/rubocop/cop/style/indentation_width.rb +11 -11
  234. data/lib/rubocop/cop/style/infinite_loop.rb +5 -9
  235. data/lib/rubocop/cop/style/initial_indentation.rb +2 -1
  236. data/lib/rubocop/cop/style/inline_comment.rb +2 -1
  237. data/lib/rubocop/cop/style/lambda.rb +14 -11
  238. data/lib/rubocop/cop/style/lambda_call.rb +4 -4
  239. data/lib/rubocop/cop/style/leading_comment_space.rb +2 -1
  240. data/lib/rubocop/cop/style/line_end_concatenation.rb +3 -1
  241. data/lib/rubocop/cop/style/method_call_parentheses.rb +9 -1
  242. data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +3 -2
  243. data/lib/rubocop/cop/style/method_def_parentheses.rb +4 -4
  244. data/lib/rubocop/cop/style/method_name.rb +1 -0
  245. data/lib/rubocop/cop/style/missing_else.rb +5 -3
  246. data/lib/rubocop/cop/style/module_function.rb +2 -1
  247. data/lib/rubocop/cop/style/multiline_array_brace_layout.rb +95 -0
  248. data/lib/rubocop/cop/style/multiline_assignment_layout.rb +91 -0
  249. data/lib/rubocop/cop/style/multiline_block_chain.rb +3 -2
  250. data/lib/rubocop/cop/style/multiline_block_layout.rb +11 -9
  251. data/lib/rubocop/cop/style/multiline_if_then.rb +1 -0
  252. data/lib/rubocop/cop/style/multiline_method_call_indentation.rb +137 -0
  253. data/lib/rubocop/cop/style/multiline_operation_indentation.rb +25 -135
  254. data/lib/rubocop/cop/style/multiline_ternary_operator.rb +2 -1
  255. data/lib/rubocop/cop/style/mutable_constant.rb +4 -5
  256. data/lib/rubocop/cop/style/negated_if.rb +3 -3
  257. data/lib/rubocop/cop/style/negated_while.rb +3 -3
  258. data/lib/rubocop/cop/style/nested_modifier.rb +6 -5
  259. data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +48 -0
  260. data/lib/rubocop/cop/style/nested_ternary_operator.rb +2 -1
  261. data/lib/rubocop/cop/style/next.rb +79 -15
  262. data/lib/rubocop/cop/style/nil_comparison.rb +5 -5
  263. data/lib/rubocop/cop/style/non_nil_check.rb +5 -5
  264. data/lib/rubocop/cop/style/not.rb +5 -9
  265. data/lib/rubocop/cop/style/numeric_literals.rb +5 -4
  266. data/lib/rubocop/cop/style/one_line_conditional.rb +3 -2
  267. data/lib/rubocop/cop/style/op_method.rb +7 -4
  268. data/lib/rubocop/cop/style/option_hash.rb +13 -7
  269. data/lib/rubocop/cop/style/optional_arguments.rb +3 -2
  270. data/lib/rubocop/cop/style/parallel_assignment.rb +40 -16
  271. data/lib/rubocop/cop/style/parentheses_around_condition.rb +3 -16
  272. data/lib/rubocop/cop/style/percent_literal_delimiters.rb +3 -2
  273. data/lib/rubocop/cop/style/percent_q_literals.rb +3 -6
  274. data/lib/rubocop/cop/style/perl_backrefs.rb +4 -3
  275. data/lib/rubocop/cop/style/predicate_name.rb +1 -0
  276. data/lib/rubocop/cop/style/proc.rb +3 -2
  277. data/lib/rubocop/cop/style/raise_args.rb +2 -1
  278. data/lib/rubocop/cop/style/redundant_begin.rb +2 -1
  279. data/lib/rubocop/cop/style/redundant_exception.rb +5 -5
  280. data/lib/rubocop/cop/style/redundant_freeze.rb +5 -4
  281. data/lib/rubocop/cop/style/redundant_parentheses.rb +80 -0
  282. data/lib/rubocop/cop/style/redundant_return.rb +5 -4
  283. data/lib/rubocop/cop/style/redundant_self.rb +7 -8
  284. data/lib/rubocop/cop/style/regexp_literal.rb +9 -8
  285. data/lib/rubocop/cop/style/rescue_ensure_alignment.rb +3 -2
  286. data/lib/rubocop/cop/style/rescue_modifier.rb +11 -9
  287. data/lib/rubocop/cop/style/self_assignment.rb +4 -5
  288. data/lib/rubocop/cop/style/semicolon.rb +3 -2
  289. data/lib/rubocop/cop/style/send.rb +3 -1
  290. data/lib/rubocop/cop/style/signal_exception.rb +5 -3
  291. data/lib/rubocop/cop/style/single_line_block_params.rb +2 -1
  292. data/lib/rubocop/cop/style/single_line_methods.rb +7 -7
  293. data/lib/rubocop/cop/style/space_after_colon.rb +2 -1
  294. data/lib/rubocop/cop/style/space_after_comma.rb +1 -0
  295. data/lib/rubocop/cop/style/space_after_control_keyword.rb +5 -5
  296. data/lib/rubocop/cop/style/space_after_method_name.rb +3 -2
  297. data/lib/rubocop/cop/style/space_after_not.rb +4 -3
  298. data/lib/rubocop/cop/style/space_after_semicolon.rb +1 -0
  299. data/lib/rubocop/cop/style/space_around_block_parameters.rb +8 -7
  300. data/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +1 -0
  301. data/lib/rubocop/cop/style/space_around_operators.rb +72 -32
  302. data/lib/rubocop/cop/style/space_before_block_braces.rb +2 -1
  303. data/lib/rubocop/cop/style/space_before_comma.rb +1 -0
  304. data/lib/rubocop/cop/style/space_before_comment.rb +2 -1
  305. data/lib/rubocop/cop/style/{single_space_before_first_arg.rb → space_before_first_arg.rb} +13 -4
  306. data/lib/rubocop/cop/style/space_before_modifier_keyword.rb +4 -3
  307. data/lib/rubocop/cop/style/space_before_semicolon.rb +1 -0
  308. data/lib/rubocop/cop/style/space_inside_block_braces.rb +3 -2
  309. data/lib/rubocop/cop/style/space_inside_brackets.rb +1 -0
  310. data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +4 -1
  311. data/lib/rubocop/cop/style/space_inside_parens.rb +1 -0
  312. data/lib/rubocop/cop/style/space_inside_range_literal.rb +5 -4
  313. data/lib/rubocop/cop/style/space_inside_string_interpolation.rb +8 -17
  314. data/lib/rubocop/cop/style/special_global_vars.rb +97 -52
  315. data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +16 -9
  316. data/lib/rubocop/cop/style/string_literals.rb +41 -1
  317. data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +2 -1
  318. data/lib/rubocop/cop/style/string_methods.rb +2 -1
  319. data/lib/rubocop/cop/style/struct_inheritance.rb +3 -2
  320. data/lib/rubocop/cop/style/symbol_array.rb +74 -7
  321. data/lib/rubocop/cop/style/symbol_literal.rb +4 -7
  322. data/lib/rubocop/cop/style/symbol_proc.rb +11 -7
  323. data/lib/rubocop/cop/style/tab.rb +25 -2
  324. data/lib/rubocop/cop/style/trailing_blank_lines.rb +1 -2
  325. data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +45 -0
  326. data/lib/rubocop/cop/style/trailing_comma_in_literal.rb +56 -0
  327. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +8 -7
  328. data/lib/rubocop/cop/style/trailing_whitespace.rb +2 -1
  329. data/lib/rubocop/cop/style/trivial_accessors.rb +18 -9
  330. data/lib/rubocop/cop/style/unless_else.rb +2 -1
  331. data/lib/rubocop/cop/style/unneeded_capital_w.rb +4 -3
  332. data/lib/rubocop/cop/style/unneeded_interpolation.rb +87 -0
  333. data/lib/rubocop/cop/style/unneeded_percent_q.rb +23 -7
  334. data/lib/rubocop/cop/style/variable_interpolation.rb +8 -6
  335. data/lib/rubocop/cop/style/variable_name.rb +1 -0
  336. data/lib/rubocop/cop/style/when_then.rb +2 -1
  337. data/lib/rubocop/cop/style/while_until_do.rb +3 -2
  338. data/lib/rubocop/cop/style/while_until_modifier.rb +3 -4
  339. data/lib/rubocop/cop/style/word_array.rb +74 -51
  340. data/lib/rubocop/cop/team.rb +21 -15
  341. data/lib/rubocop/cop/util.rb +102 -69
  342. data/lib/rubocop/cop/variable_force.rb +2 -1
  343. data/lib/rubocop/cop/variable_force/assignment.rb +2 -1
  344. data/lib/rubocop/cop/variable_force/locatable.rb +1 -0
  345. data/lib/rubocop/cop/variable_force/reference.rb +1 -0
  346. data/lib/rubocop/cop/variable_force/scope.rb +2 -1
  347. data/lib/rubocop/cop/variable_force/variable.rb +2 -1
  348. data/lib/rubocop/cop/variable_force/variable_table.rb +2 -1
  349. data/lib/rubocop/error.rb +12 -0
  350. data/lib/rubocop/formatter/base_formatter.rb +10 -1
  351. data/lib/rubocop/formatter/clang_style_formatter.rb +1 -0
  352. data/lib/rubocop/formatter/colorizable.rb +6 -1
  353. data/lib/rubocop/formatter/disabled_config_formatter.rb +29 -15
  354. data/lib/rubocop/formatter/disabled_lines_formatter.rb +3 -1
  355. data/lib/rubocop/formatter/emacs_style_formatter.rb +7 -3
  356. data/lib/rubocop/formatter/file_list_formatter.rb +1 -0
  357. data/lib/rubocop/formatter/formatter_set.rb +10 -19
  358. data/lib/rubocop/formatter/fuubar_style_formatter.rb +2 -1
  359. data/lib/rubocop/formatter/html_formatter.rb +15 -14
  360. data/lib/rubocop/formatter/json_formatter.rb +2 -1
  361. data/lib/rubocop/formatter/offense_count_formatter.rb +1 -0
  362. data/lib/rubocop/formatter/progress_formatter.rb +3 -3
  363. data/lib/rubocop/formatter/simple_text_formatter.rb +50 -17
  364. data/lib/rubocop/formatter/text_util.rb +8 -10
  365. data/lib/rubocop/formatter/worst_offenders_formatter.rb +61 -0
  366. data/lib/rubocop/name_similarity.rb +22 -0
  367. data/lib/rubocop/node_pattern.rb +126 -35
  368. data/lib/rubocop/options.rb +28 -19
  369. data/lib/rubocop/path_util.rb +1 -0
  370. data/lib/rubocop/processed_source.rb +41 -16
  371. data/lib/rubocop/rake_task.rb +6 -9
  372. data/lib/rubocop/remote_config.rb +1 -0
  373. data/lib/rubocop/result_cache.rb +60 -43
  374. data/lib/rubocop/runner.rb +48 -45
  375. data/lib/rubocop/string_util.rb +1 -0
  376. data/lib/rubocop/target_finder.rb +2 -1
  377. data/lib/rubocop/token.rb +1 -0
  378. data/lib/rubocop/version.rb +3 -2
  379. data/lib/rubocop/warning.rb +1 -0
  380. data/relnotes/v0.36.0.md +306 -0
  381. data/rubocop.gemspec +3 -9
  382. metadata +48 -92
  383. data/lib/rubocop/cop/lint/space_before_first_arg.rb +0 -44
  384. data/lib/rubocop/cop/rails/default_scope.rb +0 -33
  385. data/lib/rubocop/cop/style/trailing_comma.rb +0 -182
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module RuboCop
4
5
  # This module provides approximate string matching methods.
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'set'
4
5
 
@@ -104,7 +105,7 @@ module RuboCop
104
105
 
105
106
  def toplevel_dirs(base_dir, flags)
106
107
  Dir.glob(File.join(base_dir, '*'), flags).select do |dir|
107
- File.directory?(dir) && !(dir.end_with?('/.') || dir.end_with?('/..'))
108
+ File.directory?(dir) && !dir.end_with?('/.', '/..')
108
109
  end
109
110
  end
110
111
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module RuboCop
4
5
  # A basic wrapper around Parser's tokens.
@@ -1,11 +1,12 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module RuboCop
4
5
  # This module holds the RuboCop version information.
5
6
  module Version
6
- STRING = '0.35.1'
7
+ STRING = '0.36.0'.freeze
7
8
 
8
- MSG = '%s (using Parser %s, running on %s %s %s)'
9
+ MSG = '%s (using Parser %s, running on %s %s %s)'.freeze
9
10
 
10
11
  module_function
11
12
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module RuboCop
4
5
  # A Warning exception is different from an Offense with severity 'warning'
@@ -0,0 +1,306 @@
1
+ An epic release - the one which contains the most new features and
2
+ bugfixes since the inception of the project! A huge thanks to the
3
+ amazing contributors who helped make it a reality!
4
+
5
+ Notabley, this release adds support for Ruby 2.3 and introduces the
6
+ important concept of a target Ruby version - meaning RuboCop will no
7
+ longer try to parse the code with a parser matching the interpreter
8
+ you're using, but a parser matching the target Ruby version you
9
+ specified in `.rubocop.yml`. This way you won't introduce accidentally
10
+ syntax from a newer Ruby when you want to maintain
11
+ compatibility with certain older Rubies.
12
+
13
+ Enjoy!
14
+
15
+ ### New features
16
+
17
+ * [#2598](https://github.com/bbatsov/rubocop/pull/2598): New cop `Lint/RandOne` checks for `rand(1)`, `Kernel.rand(1.0)` and similar calls. Such call are most likely a mistake because they always return `0`. ([@DNNX][])
18
+ * [#2590](https://github.com/bbatsov/rubocop/pull/2590): New cop `Performance/DoubleStartEndWith` checks for two `start_with?` (or `end_with?`) calls joined by `||` with the same receiver, like `str.start_with?('x') || str.start_with?('y')` and suggests using one call instead: `str.start_with?('x', 'y')`. ([@DNNX][])
19
+ * [#2583](https://github.com/bbatsov/rubocop/pull/2583): New cop `Performance/TimesMap` checks for `x.times.map{}` and suggests replacing them with `Array.new(x){}`. ([@DNNX][])
20
+ * [#2529](https://github.com/bbatsov/rubocop/pull/2529): Add EnforcedStyle config parameter to IndentArray. ([@jawshooah][])
21
+ * [#2479](https://github.com/bbatsov/rubocop/pull/2479): Add option `AllowHeredoc` to `Metrics/LineLength`. ([@fphilipe][])
22
+ * [#2416](https://github.com/bbatsov/rubocop/pull/2416): New cop `Style/ConditionalAssignment` checks for assignment of the same variable in all branches of conditionals and replaces them with a single assignment to the return of the conditional. ([@rrosenblum][])
23
+ * [#2410](https://github.com/bbatsov/rubocop/pull/2410): New cop `Style/IndentAssignment` checks the indentation of the first line of the right-hand-side of a multi-line assignment. ([@panthomakos][])
24
+ * [#2431](https://github.com/bbatsov/rubocop/issues/2431): Add `IgnoreExecutableScripts` option to `Style/FileName`. ([@sometimesfood][])
25
+ * [#2460](https://github.com/bbatsov/rubocop/pull/2460): New cop `Style/UnneededInterpolation` checks for strings that are just an interpolated expression. ([@cgriego][])
26
+ * [#2361](https://github.com/bbatsov/rubocop/pull/2361): `Style/MultilineAssignmentLayout` cop checks for a newline after the assignment operator in a multi-line assignment. ([@panthomakos][])
27
+ * [#2462](https://github.com/bbatsov/rubocop/issues/2462): `Lint/UselessAccessModifier` can catch more types of useless access modifiers. ([@alexdowad][])
28
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/Casecmp` cop. ([@alexdowad][])
29
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RangeInclude` cop. ([@alexdowad][])
30
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantSortBy` cop. ([@alexdowad][])
31
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/LstripRstrip` cop. ([@alexdowad][])
32
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/StartWith` cop. ([@alexdowad][])
33
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/EndWith` cop. ([@alexdowad][])
34
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantMerge` cop. ([@alexdowad][])
35
+ * `Lint/Debugger` cop can now auto-correct offenses. ([@alexdowad][])
36
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantMatch` cop. ([@alexdowad][])
37
+ * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantBlockCall` cop. ([@alexdowad][])
38
+ * [#1954](https://github.com/bbatsov/rubocop/issues/1954): `Lint/UnneededDisable` can now autocorrect. ([@alexdowad][])
39
+ * [#2501](https://github.com/bbatsov/rubocop/issues/2501): Add new `Lint/ImplicitStringConcatenation` cop. ([@alexdowad][])
40
+ * Add new `Style/RedundantParentheses` cop. ([@lumeet][])
41
+ * [#1346](https://github.com/bbatsov/rubocop/issues/1346): `Style/SpecialGlobalVars` can be configured to use either `use_english_names` or `use_perl_names` styles. ([@alexdowad][])
42
+ * [#2426](https://github.com/bbatsov/rubocop/issues/2426): New `Style/NestedParenthesizedCalls` cop checks for non-parenthesized method calls nested inside a parenthesized call, like `method1(method2 arg)`. ([@alexdowad][])
43
+ * [#2502](https://github.com/bbatsov/rubocop/issues/2502): The `--stdin` and `--auto-correct` CLI options can be combined, and if you do so, corrected code is printed to stdout. ([@alexdowad][])
44
+ * `Style/ConditionalAssignment` works on conditionals with a common aref assignment (like `array[index] = val`) or attribute assignment (like `self.attribute = val`). ([@alexdowad][])
45
+ * [#2476](https://github.com/bbatsov/rubocop/issues/2476): `Style/GuardClause` catches if..else nodes with one branch which terminates the execution of the current scope. ([@alexdowad][])
46
+ * New `Style/IdenticalConditionalBranches` flags `if..else` and `case..when..else` constructs with an identical line at the end of each branch. ([@alexdowad][])
47
+ * [#207](https://github.com/bbatsov/rubocop/issues/207): Add new `Lint/FloatOutOfRange` cop which catches floating-point literals which are too large or too small for Ruby to represent. ([@alexdowad][])
48
+ * `Style/GuardClause` doesn't report offenses in places where correction would make a line too long. ([@alexdowad][])
49
+ * `Lint/DuplicateMethods` can find duplicate method definitions in many more circumstances, even across multiple files; however, it ignores definitions inside `if` or something which could be a DSL method. ([@alexdowad][])
50
+ * A warning is printed if an invalid `EnforcedStyle` is configured. ([@alexdowad][])
51
+ * [#1367](https://github.com/bbatsov/rubocop/issues/1367): New `Lint/IneffectiveAccessModifier` checks for access modifiers which are erroneously applied to a singleton method, where they have no effect. ([@alexdowad][])
52
+ * [#1614](https://github.com/bbatsov/rubocop/issues/1614): `Lint/BlockAlignment` aligns block end with splat operator when applied to a splatted method call. ([@alexdowad][])
53
+ * [#2263](https://github.com/bbatsov/rubocop/issues/2263): Warn if `task.options = %w(--format ...)` is used when configuring `RuboCop::RakeTask`; this should be `task.formatters = ...` instead. ([@alexdowad][])
54
+ * [#2511](https://github.com/bbatsov/rubocop/issues/2511): `--no-offense-counts` CLI option suppresses the inclusion of offense count lines in auto-generated config. ([@alexdowad][])
55
+ * [#2504](https://github.com/bbatsov/rubocop/issues/2504): New `AllowForAlignment` config parameter for `Style/SingleSpaceBeforeFirstArg` allows the insertion of extra spaces before the first argument if it aligns it with something on the preceding or following line. ([@alexdowad][])
56
+ * [#2478](https://github.com/bbatsov/rubocop/issues/2478): `Style/ExtraSpacing` has new `ForceEqualSignAlignment` config parameter which forces = signs on consecutive lines to be aligned, and it can auto-correct. ([@alexdowad][])
57
+ * `Lint/BlockAlignment` aligns block end with unary operators like ~, -, or ! when such operators are applied to the method call taking the block. ([@alexdowad][])
58
+ * [#1460](https://github.com/bbatsov/rubocop/issues/1460): `Style/Alias` supports both `prefer_alias` and `prefer_alias_method` styles. ([@alexdowad][])
59
+ * [#1569](https://github.com/bbatsov/rubocop/issues/1569): New `ExpectMatchingDefinition` config parameter for `Style/FileName` makes it check for a class or module definition in each file which corresponds to the file name and path. ([@alexdowad][])
60
+ * [#2480](https://github.com/bbatsov/rubocop/pull/2480): Add a configuration to `Style/ConditionalAssignment` to check and correct conditionals that contain multiple assignments. ([@rrosenblum][])
61
+ * [#2480](https://github.com/bbatsov/rubocop/pull/2480): Allow `Style/ConditionalAssignment` to correct assignment in ternary operations. ([@rrosenblum][])
62
+ * [#2480](https://github.com/bbatsov/rubocop/pull/2480): Allow `Style/ConditionalAssignment` to correct comparable methods. ([@rrosenblum][])
63
+ * [#1633](https://github.com/bbatsov/rubocop/issues/1633): New cop `Style/MultilineMethodCallIndentation` takes over the responsibility for checking alignment of methods from the `Style/MultilineOperationIndentation` cop. ([@jonas054][])
64
+ * [#2472](https://github.com/bbatsov/rubocop/pull/2472): New cop `Style/MultilineArrayBraceLayout` checks that the closing brace in an array literal is symmetrical with respect to the opening brace and the array elements. ([@panthomakos][])
65
+ * [#1543](https://github.com/bbatsov/rubocop/issues/1543): `Style/WordArray` has both `percent` and `brackets` (which enforces the use of bracketed arrays for strings) styles. ([@alexdowad][])
66
+ * `Style/SpaceAroundOperators` has `AllowForAlignment` config parameter which allows extra spaces on the left if they serve to align the operator with another. ([@alexdowad][])
67
+ * `Style/SymbolArray` has both `percent` and `brackets` (which enforces the user of bracketed arrays for symbols) styles. ([@alexdowad][])
68
+ * [#2343](https://github.com/bbatsov/rubocop/issues/2343): Entire cop types (or "departments") can be disabled using in .rubocop.yml using config like `Style: Enabled: false`. ([@alexdowad][])
69
+ * [#2399](https://github.com/bbatsov/rubocop/issues/2399): New `start_of_line` style for `Lint/EndAlignment` aligns a closing `end` keyword with the start of the line where the opening keyword appears. ([@alexdowad][])
70
+ * [#1545](https://github.com/bbatsov/rubocop/issues/1545): New `Regex` config parameter for `Style/FileName` allows user to provide their own regex for validating file names. ([@alexdowad][])
71
+ * [#2253](https://github.com/bbatsov/rubocop/issues/2253): New `DefaultFormatter` config parameter can be used to set formatter from within .rubocop.yml. ([@alexdowad][])
72
+ * [#2481](https://github.com/bbatsov/rubocop/issues/2481): New `WorstOffendersFormatter` prints a list of files with offenses (and offense counts), showing the files with the most offenses first. ([@alexdowad][])
73
+ * New `IfInsideElse` cop catches `if..end` nodes which can be converted into an `elsif` instead, reducing the nesting level. ([@alexdowad][])
74
+ * [#1725](https://github.com/bbatsov/rubocop/issues/1725): --color CLI option forces color output, even when not printing to a TTY. ([@alexdowad][])
75
+ * [#2549](https://github.com/bbatsov/rubocop/issues/2549): New `ConsistentQuotesInMultiline` config param for `Style/StringLiterals` forces all literals which are concatenated using \ to use the same quote style. ([@alexdowad][])
76
+ * [#2560](https://github.com/bbatsov/rubocop/issues/2560): `Style/AccessModifierIndentation`, `Style/CaseIndentation`, `Style/FirstParameterIndentation`, `Style/IndentArray`, `Style/IndentAssignment`, `Style/IndentHash`, `Style/MultilineMethodCallIndentation`, and `Style/MultilineOperationIndentation` all have a new `IndentationWidth` parameter which can be used to override the indentation width from `Style/IndentationWidth`. ([@alexdowad][])
77
+ * Add new `Performance/HashEachMethods` cop. ([@ojab][])
78
+ * New cop `Style/FrozenStringLiteralComment` will check for and add the comment `# frozen_string_literal: true` to the top of files. This will help with upgrading to Ruby 3.0. ([@rrosenblum][])
79
+
80
+ ### Bug Fixes
81
+
82
+ * [#2594](https://github.com/bbatsov/rubocop/issues/2594): `Style/EmptyLiteral` autocorrector respects `Style/StringLiterals:EnforcedStyle` config. ([@DNNX][])
83
+ * [#2411](https://github.com/bbatsov/rubocop/issues/2411): Make local inherited configuration override configuration loaded from gems. ([@jonas054][])
84
+ * [#2413](https://github.com/bbatsov/rubocop/issues/2413): Allow `%Q` for dynamic strings with double quotes inside them. ([@jonas054][])
85
+ * [#2404](https://github.com/bbatsov/rubocop/issues/2404): `Style/Next` does not remove comments when auto-correcting. ([@lumeet][])
86
+ * `Style/Next` handles auto-correction of nested offenses. ([@lumeet][])
87
+ * `Style/VariableInterpolation` now detects non-numeric regex back references. ([@cgriego][])
88
+ * `ProgressFormatter` fully respects the `--no-color` switch. ([@savef][])
89
+ * Replace `Time.zone.current` with `Time.current` on `Rails::TimeZone` cop message. ([@volmer][])
90
+ * [#2451](https://github.com/bbatsov/rubocop/issues/2451): `Style/StabbyLambdaParentheses` does not treat method calls named `lambda` as lambdas. ([@domcleal][])
91
+ * [#2463](https://github.com/bbatsov/rubocop/issues/2463): Allow comments before an access modifier. ([@codebeige][])
92
+ * [#2471](https://github.com/bbatsov/rubocop/issues/2471): `Style/MethodName` doesn't choke on methods which are defined inside methods. ([@alexdowad][])
93
+ * [#2449](https://github.com/bbatsov/rubocop/issues/2449): `Style/StabbyLambdaParentheses` only checks lambdas in the arrow form. ([@lumeet][])
94
+ * [#2456](https://github.com/bbatsov/rubocop/issues/2456): `Lint/NestedMethodDefinition` doesn't register offenses for method definitions inside an eval block (either `instance_eval`, `class_eval`, or `module_eval`). ([@alexdowad][])
95
+ * [#2464](https://github.com/bbatsov/rubocop/issues/2464): `Style/ParallelAssignment` understands aref and attribute assignments, and doesn't warn if they can't be correctly rearranged into a series of single assignments. ([@alexdowad][])
96
+ * [#2482](https://github.com/bbatsov/rubocop/issues/2482): `Style/AndOr` doesn't raise an exception when trying to autocorrect `!variable or ...`. ([@alexdowad][])
97
+ * [#2446](https://github.com/bbatsov/rubocop/issues/2446): `Style/Tab` doesn't register errors for leading tabs which occur inside a string literal (including heredoc). ([@alexdowad][])
98
+ * [#2452](https://github.com/bbatsov/rubocop/issues/2452): `Style/TrailingComma` incorrectly categorizes single-line hashes in methods calls. ([@panthomakos][])
99
+ * [#2441](https://github.com/bbatsov/rubocop/issues/2441): `Style/AlignParameters` doesn't crash if it finds nested offenses. ([@alexdowad][])
100
+ * [#2436](https://github.com/bbatsov/rubocop/issues/2436): `Style/SpaceInsideHashLiteralBraces` doesn't mangle a hash literal which is not surrounded by curly braces, but has another hash literal which does as its first key. ([@alexdowad][])
101
+ * [#2483](https://github.com/bbatsov/rubocop/issues/2483): `Style/Attr` differentiate between attr_accessor and attr_reader. ([@weh][])
102
+ * `Style/ConditionalAssignment` doesn't crash if it finds a `case` with an empty branch. ([@lumeet][])
103
+ * [#2506](https://github.com/bbatsov/rubocop/issues/2506): `Lint/FormatParameterMismatch` understands %{} and %<> interpolations. ([@alexdowad][])
104
+ * [#2145](https://github.com/bbatsov/rubocop/issues/2145): `Lint/ParenthesesAsGroupedExpression` ignores calls with multiple arguments, since they are not ambiguous. ([@alexdowad][])
105
+ * [#2484](https://github.com/bbatsov/rubocop/issues/2484): Remove two vulnerabilities in cache handling. ([@jonas054][])
106
+ * [#2517](https://github.com/bbatsov/rubocop/issues/2517): `Lint/UselessAccessModifier` doesn't think that an access modifier applied to `attr_writer` is useless. ([@alexdowad][])
107
+ * [#2518](https://github.com/bbatsov/rubocop/issues/2518): `Style/ConditionalAssignment` doesn't think that branches using `<<` and `[]=` should be combined. ([@alexdowad][])
108
+ * `CharacterLiteral` auto-corrector now properly corrects `?'`. ([@bfontaine][])
109
+ * [#2313](https://github.com/bbatsov/rubocop/issues/2313): `Rails/FindEach` doesn't break code which uses `order(...).each`, `limit(...).each`, and so on. ([@alexdowad][])
110
+ * [#1938](https://github.com/bbatsov/rubocop/issues/1938): `Rails/FindBy` doesn't autocorrect `where(...).first` to `find_by`, since the returned record is often different. ([@alexdowad][])
111
+ * [#1801](https://github.com/bbatsov/rubocop/issues/1801): `EmacsFormatter` strips newlines out of error messages, if there are any. ([@alexdowad][])
112
+ * [#2534](https://github.com/bbatsov/rubocop/issues/2534): `Style/RescueEnsureAlignment` works on `rescue` nested inside a `class` or `module` block. ([@alexdowad][])
113
+ * `Lint/BlockAlignment` does not refer to a block terminator as `end` when it is actually `}`. ([@alexdowad][])
114
+ * [#2540](https://github.com/bbatsov/rubocop/issues/2540): `Lint/FormatParameterMismatch` understands format specifiers with multiple flags. ([@alexdowad][])
115
+ * [#2538](https://github.com/bbatsov/rubocop/issues/2538): `Style/SpaceAroundOperators` doesn't eat newlines. ([@alexdowad][])
116
+ * [#2531](https://github.com/bbatsov/rubocop/issues/2531): `Style/AndOr` autocorrects in cases where parentheses must be added, even inside a nested begin node. ([@alexdowad][])
117
+ * [#2450](https://github.com/bbatsov/rubocop/issues/2450): `Style/Next` adjusts indentation when auto-correcting, to avoid introducing new offenses. ([@alexdowad][])
118
+ * [#2066](https://github.com/bbatsov/rubocop/issues/2066): `Style/TrivialAccessors` doesn't flag what appear to be trivial accessor method definitions, if they are nested inside a call to `instance_eval`. ([@alexdowad][])
119
+ * `Style/SymbolArray` doesn't flag arrays of symbols if a symbol contains a space character. ([@alexdowad][])
120
+ * `Style/SymbolArray` can auto-correct offenses. ([@alexdowad][])
121
+ * [#2546](https://github.com/bbatsov/rubocop/issues/2546): Report when two `rubocop:disable` comments (not the single line kind) for a given cop apppear in a file with no `rubocop:enable` in between. ([@jonas054][])
122
+ * [#2552](https://github.com/bbatsov/rubocop/issues/2552): `Style/Encoding` can auto-correct files with a blank first line. ([@alexdowad][])
123
+ * [#2556](https://github.com/bbatsov/rubocop/issues/2556): `Style/SpecialGlobalVariables` generates auto-config correctly. ([@alexdowad][])
124
+ * [#2565](https://github.com/bbatsov/rubocop/issues/2565): Let `Style/SpaceAroundOperators` leave spacing around `=>` to `Style/AlignHash`. ([@jonas054][])
125
+ * [#2569](https://github.com/bbatsov/rubocop/issues/2569): `Style/MethodCallParentheses` doesn't register warnings for `object.()` syntax, since it is handled by `Style/LambdaCall`. ([@alexdowad][])
126
+ * [#2570](https://github.com/bbatsov/rubocop/issues/2570): `Performance/RedundantMerge` doesn't break code with a modifier `if` when autocorrecting. ([@alexdowad][])
127
+ * `Performance/RedundantMerge` doesn't break code with a modifier `while` or `until` when autocorrecting. ([@alexdowad][])
128
+ * [#2574](https://github.com/bbatsov/rubocop/issues/2574): `variable` style for `Lint/EndAlignment` is working again. ([@alexdowad][])
129
+ * `Lint/EndAlignment` can autocorrect offenses on the RHS of an assignment to an instance variable, class variable, constant, and so on; previously, it only worked if the LHS was a local variable. ([@alexdowad][])
130
+ * [#2580](https://github.com/bbatsov/rubocop/issues/2580): `Style/StringReplacement` doesn't break code when autocorrection involves a regex with embedded escapes (like /\n/). ([@alexdowad][])
131
+ * [#2582](https://github.com/bbatsov/rubocop/issues/2582): `Style/AlignHash` doesn't move a key so far left that it goes onto the previous line (in an attempt to align). ([@alexdowad][])
132
+ * [#2588](https://github.com/bbatsov/rubocop/issues/2588): `Style/SymbolProc` doesn't break code when autocorrecting a method call with a trailing comma in the argument list. ([@alexdowad][])
133
+ * [#2448](https://github.com/bbatsov/rubocop/issues/2448): `Style/TrailingCommaInArguments` and `Style/TrailingCommaInLiteral` don't special-case single-item lists in a way which contradicts the documentation. ([@alexdowad][])
134
+ * Fix for remote config files to only load from on http and https URLs. ([@ptrippett][])
135
+ * [#2604](https://github.com/bbatsov/rubocop/issues/2604): `Style/FileName` doesn't fail on empty files when `ExpectMatchingDefinition` is true. ([@alexdowad][])
136
+ * `Style/RedundantFreeze` registers offences for frozen dynamic symbols. ([@segiddins][])
137
+ * [#2609](https://github.com/bbatsov/rubocop/issues/2609): All cops which rely on the `AutocorrectUnlessChangingAST` module can now autocorrect files which contain `__FILE__`. ([@alexdowad][])
138
+ * [#2608](https://github.com/bbatsov/rubocop/issues/2608): `Style/ConditionalAssignment` can autocorrect `=~` within a ternary expression. ([@alexdowad][])
139
+
140
+ ### Changes
141
+
142
+ * [#2427](https://github.com/bbatsov/rubocop/pull/2427): Allow non-snake-case file names (e.g. `some-random-script`) for Ruby scripts that have a shebang. ([@sometimesfood][])
143
+ * [#2430](https://github.com/bbatsov/rubocop/pull/2430): `Lint/UnneededDisable` now adds "unknown cop" to messages if cop names in `rubocop:disable` comments are unrecognized, or "did you mean ..." if they are misspelled names of existing cops. ([@jonas054][])
144
+ * [#947](https://github.com/bbatsov/rubocop/issues/947): `Style/Documentation` considers classes and modules which only define constants to be "namespaces", and doesn't flag them for lack of a documentation comment. ([@alexdowad][])
145
+ * [#2467](https://github.com/bbatsov/rubocop/issues/2467): Explicitly inheriting configuration from the rubocop gem in .rubocop.yml is not allowed. ([@alexdowad][])
146
+ * [#2322](https://github.com/bbatsov/rubocop/issues/2322): Output of --auto-gen-config shows content of default config parameters which are Arrays; this is especially useful for SupportedStyles. ([@alexdowad][])
147
+ * [#1566](https://github.com/bbatsov/rubocop/issues/1566): When autocorrecting on Windows, line endings are not converted to "\r\n" in untouched portions of the source files; corrected portions may use "\n" rather than "\r\n". ([@alexdowad][])
148
+ * New `rake repl` task can be used for experimentation when working on RuboCop. ([@alexdowad][])
149
+ * `Lint/SpaceBeforeFirstArg` cop has been removed, since it just duplicates `Style/SingleSpaceBeforeFirstArg`. ([@alexdowad][])
150
+ * `Style/SingleSpaceBeforeFirstArg` cop has been renamed to `Style/SpaceBeforeFirstArg`, which more accurately reflects what it now does. ([@alexdowad][])
151
+ * `Style/UnneededPercentQ` reports `%q()` strings with what only appears to be an escape, but is not really (there are no escapes in `%q()` strings). ([@alexdowad][])
152
+ * `Performance/StringReplacement`, `Performance\StartWith`, and `Performance\EndWith` more accurately identify code which can be improved. ([@alexdowad][])
153
+ * The `MultiSpaceAllowedForOperators` config parameter for `Style/SpaceAroundOperators` has been removed, as it is made redundant by `AllowForAlignment`. If someone attempts to use it, config validation will fail with a helpful message. ([@alexdowad][])
154
+ * The `RunRailsCops` config parameter in .rubocop.yml is now obsolete. If someone attempts to use it, config validation will fail with a helpful message. ([@alexdowad][])
155
+ * If .rubocop.yml contains configuration for a custom cop, no warning regarding "unknown cop" will be printed. The custom cop must inherit from RuboCop::Cop::Cop, and must be loaded into memory for this to work. ([@alexdowad][])
156
+ * [#2102](https://github.com/bbatsov/rubocop/issues/2102): If .rubocop.yml exists in the working directory when running --auto-gen-config, any `Exclude` config parameters in .rubocop.yml will be merged into the generated .rubocop_todo.yml. ([@alexdowad][])
157
+ * [#1895](https://github.com/bbatsov/rubocop/issues/1895): Remove `Rails/DefaultScope` cop. ([@alexdowad][])
158
+ * [#2550](https://github.com/bbatsov/rubocop/issues/2550): New `TargetRubyVersion` configuration parameter can be used to specify which version of the Ruby interpreter the inspected code is intended to run on. ([@alexdowad][])
159
+ * [#2557](https://github.com/bbatsov/rubocop/issues/2557): `Style/GuardClause` does not warn about `if` nodes whose condition spans multiple lines. ([@alexdowad][])
160
+ * `Style/EmptyLinesAroundClassBody`, `Style/EmptyLinesAroundModuleBody`, and `Style/EmptyLinesAroundBlockBody` accept an empty body with no blank line, even if configured to `empty_lines` style. This is because the empty lines only serve to provide a break between the header, body, and footer, and are redundant if there is no body. ([@alexdowad][])
161
+ * [#2554](https://github.com/bbatsov/rubocop/issues/2554): `Style/FirstMethodArgumentLineBreak` handles implicit hash arguments without braces; `Style/FirstHashElementLineBreak` still handles those with braces. ([@alexdowad][])
162
+ * `Style/TrailingComma` has been split into `Style/TrailingCommaInArguments` and `Style/TrailingCommaInLiteral`. ([@alexdowad][])
163
+ * RuboCop returns process exit code 2 if it fails due to bad configuration, bad CLI options, or an internal error. If it runs successfully but finds one or more offenses, it still exits with code 1, as was previously the case. This is helpful when invoking RuboCop programmatically, perhaps from a script. ([@alexdowad][])
164
+
165
+ [@bbatsov]: https://github.com/bbatsov
166
+ [@jonas054]: https://github.com/jonas054
167
+ [@yujinakayama]: https://github.com/yujinakayama
168
+ [@dblock]: https://github.com/dblock
169
+ [@nevir]: https://github.com/nevir
170
+ [@daviddavis]: https://github.com/daviddavis
171
+ [@sds]: https://github.com/sds
172
+ [@fancyremarker]: https://github.com/fancyremarker
173
+ [@sinisterchipmunk]: https://github.com/sinisterchipmunk
174
+ [@vonTronje]: https://github.com/vonTronje
175
+ [@agrimm]: https://github.com/agrimm
176
+ [@pmenglund]: https://github.com/pmenglund
177
+ [@chulkilee]: https://github.com/chulkilee
178
+ [@codez]: https://github.com/codez
179
+ [@emou]: https://github.com/emou
180
+ [@skanev]: http://github.com/skanev
181
+ [@claco]: http://github.com/claco
182
+ [@rifraf]: http://github.com/rifraf
183
+ [@scottmatthewman]: https://github.com/scottmatthewman
184
+ [@ma2gedev]: http://github.com/ma2gedev
185
+ [@jeremyolliver]: https://github.com/jeremyolliver
186
+ [@hannestyden]: https://github.com/hannestyden
187
+ [@geniou]: https://github.com/geniou
188
+ [@jkogara]: https://github.com/jkogara
189
+ [@tmorris-fiksu]: https://github.com/tmorris-fiksu
190
+ [@mockdeep]: https://github.com/mockdeep
191
+ [@hiroponz]: https://github.com/hiroponz
192
+ [@tamird]: https://github.com/tamird
193
+ [@fshowalter]: https://github.com/fshowalter
194
+ [@cschramm]: https://github.com/cschramm
195
+ [@bquorning]: https://github.com/bquorning
196
+ [@bcobb]: https://github.com/bcobb
197
+ [@irrationalfab]: https://github.com/irrationalfab
198
+ [@tommeier]: https://github.com/tommeier
199
+ [@sfeldon]: https://github.com/sfeldon
200
+ [@biinari]: https://github.com/biinari
201
+ [@barunio]: https://github.com/barunio
202
+ [@molawson]: https://github.com/molawson
203
+ [@wndhydrnt]: https://github.com/wndhydrnt
204
+ [@ggilder]: https://github.com/ggilder
205
+ [@salbertson]: https://github.com/salbertson
206
+ [@camilleldn]: https://github.com/camilleldn
207
+ [@mcls]: https://github.com/mcls
208
+ [@yous]: https://github.com/yous
209
+ [@vrthra]: https://github.com/vrthra
210
+ [@SkuliOskarsson]: https://github.com/SkuliOskarsson
211
+ [@jspanjers]: https://github.com/jspanjers
212
+ [@sch1zo]: https://github.com/sch1zo
213
+ [@smangelsdorf]: https://github.com/smangelsdorf
214
+ [@mvz]: https://github.com/mvz
215
+ [@jfelchner]: https://github.com/jfelchner
216
+ [@janraasch]: https://github.com/janraasch
217
+ [@jcarbo]: https://github.com/jcarbo
218
+ [@oneamtu]: https://github.com/oneamtu
219
+ [@toy]: https://github.com/toy
220
+ [@Koronen]: https://github.com/Koronen
221
+ [@blainesch]: https://github.com/blainesch
222
+ [@marxarelli]: https://github.com/marxarelli
223
+ [@katieschilling]: https://github.com/katieschilling
224
+ [@kakutani]: https://github.com/kakutani
225
+ [@rrosenblum]: https://github.com/rrosenblum
226
+ [@mattjmcnaughton]: https://github.com/mattjmcnaughton
227
+ [@huerlisi]: https://github.com/huerlisi
228
+ [@volkert]: https://github.com/volkert
229
+ [@lumeet]: https://github.com/lumeet
230
+ [@mmozuras]: https://github.com/mmozuras
231
+ [@d4rk5eed]: https://github.com/d4rk5eed
232
+ [@cshaffer]: https://github.com/cshaffer
233
+ [@eitoball]: https://github.com/eitoball
234
+ [@iainbeeston]: https://github.com/iainbeeston
235
+ [@pimterry]: https://github.com/pimterry
236
+ [@palkan]: https://github.com/palkan
237
+ [@jdoconnor]: https://github.com/jdoconnor
238
+ [@meganemura]: https://github.com/meganemura
239
+ [@zvkemp]: https://github.com/zvkemp
240
+ [@vassilevsky]: https://github.com/vassilevsky
241
+ [@gerry3]: https://github.com/gerry3
242
+ [@ypresto]: https://github.com/ypresto
243
+ [@clowder]: https://github.com/clowder
244
+ [@mudge]: https://github.com/mudge
245
+ [@mzp]: https://github.com/mzp
246
+ [@bankair]: https://github.com/bankair
247
+ [@crimsonknave]: https://github.com/crimsonknave
248
+ [@renuo]: https://github.com/renuo
249
+ [@sdeframond]: https://github.com/sdeframond
250
+ [@til]: https://github.com/til
251
+ [@carhartl]: https://github.com/carhartl
252
+ [@dylandavidson]: https://github.com/dylandavidson
253
+ [@tmr08c]: https://github.com/tmr08c
254
+ [@hbd225]: https://github.com/hbd225
255
+ [@l8nite]: https://github.com/l8nite
256
+ [@sumeet]: https://github.com/sumeet
257
+ [@ojab]: https://github.com/ojab
258
+ [@chastell]: https://github.com/chastell
259
+ [@glasnt]: https://github.com/glasnt
260
+ [@crazydog115]: https://github.com/crazydog115
261
+ [@RGBD]: https://github.com/RGBD
262
+ [@panthomakos]: https://github.com/panthomakos
263
+ [@matugm]: https://github.com/matugm
264
+ [@m1foley]: https://github.com/m1foley
265
+ [@tejasbubane]: https://github.com/tejasbubane
266
+ [@bmorrall]: https://github.com/bmorrall
267
+ [@fphilipe]: https://github.com/fphilipe
268
+ [@gotrevor]: https://github.com/gotrevor
269
+ [@awwaiid]: https://github.com/awwaiid
270
+ [@segiddins]: https://github.com/segiddins
271
+ [@urbanautomaton]: https://github.com/urbanautomaton.com
272
+ [@unmanbearpig]: https://github.com/unmanbearpig
273
+ [@maxjacobson]: https://github.com/maxjacobson
274
+ [@sliuu]: https://github.com/sliuu
275
+ [@edmz]: https://github.com/edmz
276
+ [@syndbg]: https://github.com/syndbg
277
+ [@wli]: https://github.com/wli
278
+ [@caseywebdev]: https://github.com/caseywebdev
279
+ [@MGerrior]: https://github.com/MGerrior
280
+ [@imtayadeway]: https://github.com/imtayadeway
281
+ [@mrfoto]: https://github.com/mrfoto
282
+ [@karreiro]: https://github.com/karreiro
283
+ [@dreyks]: https://github.com/dreyks
284
+ [@hmadison]: https://github.com/hmadison
285
+ [@miquella]: https://github.com/miquella
286
+ [@jhansche]: https://github.com/jhansche
287
+ [@cornelius]: https://github.com/cornelius
288
+ [@eagletmt]: https://github.com/eagletmt
289
+ [@apiology]: https://github.com/apiology
290
+ [@alexdowad]: https://github.com/alexdowad
291
+ [@minustehbare]: https://github.com/minustehbare
292
+ [@tansaku]: https://github.com/tansaku
293
+ [@ptrippett]: https://github.com/ptrippett
294
+ [@br3nda]: https://github.com/br3nda
295
+ [@jujugrrr]: https://github.com/jujugrrr
296
+ [@sometimesfood]: https://github.com/sometimesfood
297
+ [@cgriego]: https://github.com/cgriego
298
+ [@savef]: https://github.com/savef
299
+ [@volmer]: https://github.com/volmer
300
+ [@domcleal]: https://github.com/domcleal
301
+ [@codebeige]: https://github.com/codebeige
302
+ [@weh]: https://github.com/weh
303
+ [@bfontaine]: https://github.com/bfontaine
304
+ [@jawshooah]: https://github.com/jawshooah
305
+ [@DNNX]: https://github.com/DNNX
306
+ [@mvidner]: https://github.com/mvidner
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
4
5
  require 'rubocop/version'
@@ -39,16 +40,9 @@ Gem::Specification.new do |s|
39
40
  s.summary = 'Automatic Ruby code style checking tool.'
40
41
 
41
42
  s.add_runtime_dependency('rainbow', '>= 1.99.1', '< 3.0')
42
- s.add_runtime_dependency('parser', '>= 2.2.3.0', '< 3.0')
43
+ s.add_runtime_dependency('parser', '>= 2.3.0.0', '< 3.0')
43
44
  s.add_runtime_dependency('powerpack', '~> 0.1')
44
- s.add_runtime_dependency('astrolabe', '~> 1.3')
45
45
  s.add_runtime_dependency('ruby-progressbar', '~> 1.7')
46
- # Pinning tins due to 1.7.0 incompatibility with Ruby < 2.0
47
- # https://github.com/flori/tins/blob/v1.7.0/tins.gemspec#L19
48
- s.add_runtime_dependency('tins', '<= 1.6.0')
49
- s.add_development_dependency('rake', '~> 10.1')
50
- s.add_development_dependency('rspec', '~> 3.3.0')
51
- s.add_development_dependency('yard', '~> 0.8')
46
+
52
47
  s.add_development_dependency('bundler', '~> 1.3')
53
- s.add_development_dependency('simplecov', '~> 0.10')
54
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.35.1
4
+ version: 0.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-11-10 00:00:00.000000000 Z
13
+ date: 2016-01-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rainbow
@@ -38,7 +38,7 @@ dependencies:
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 2.2.3.0
41
+ version: 2.3.0.0
42
42
  - - "<"
43
43
  - !ruby/object:Gem::Version
44
44
  version: '3.0'
@@ -48,7 +48,7 @@ dependencies:
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- version: 2.2.3.0
51
+ version: 2.3.0.0
52
52
  - - "<"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.1'
69
- - !ruby/object:Gem::Dependency
70
- name: astrolabe
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.3'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.3'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: ruby-progressbar
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,62 +80,6 @@ dependencies:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
82
  version: '1.7'
97
- - !ruby/object:Gem::Dependency
98
- name: tins
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "<="
102
- - !ruby/object:Gem::Version
103
- version: 1.6.0
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "<="
109
- - !ruby/object:Gem::Version
110
- version: 1.6.0
111
- - !ruby/object:Gem::Dependency
112
- name: rake
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '10.1'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '10.1'
125
- - !ruby/object:Gem::Dependency
126
- name: rspec
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 3.3.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 3.3.0
139
- - !ruby/object:Gem::Dependency
140
- name: yard
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '0.8'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '0.8'
153
83
  - !ruby/object:Gem::Dependency
154
84
  name: bundler
155
85
  requirement: !ruby/object:Gem::Requirement
@@ -164,20 +94,6 @@ dependencies:
164
94
  - - "~>"
165
95
  - !ruby/object:Gem::Version
166
96
  version: '1.3'
167
- - !ruby/object:Gem::Dependency
168
- name: simplecov
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '0.10'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '0.10'
181
97
  description: |2
182
98
  Automatic Ruby code style checking tool.
183
99
  Aims to enforce the community-driven Ruby Style Guide.
@@ -202,6 +118,9 @@ files:
202
118
  - config/enabled.yml
203
119
  - lib/rubocop.rb
204
120
  - lib/rubocop/ast_node.rb
121
+ - lib/rubocop/ast_node/builder.rb
122
+ - lib/rubocop/ast_node/sexp.rb
123
+ - lib/rubocop/cached_data.rb
205
124
  - lib/rubocop/cli.rb
206
125
  - lib/rubocop/comment_config.rb
207
126
  - lib/rubocop/config.rb
@@ -232,19 +151,23 @@ files:
232
151
  - lib/rubocop/cop/lint/end_in_method.rb
233
152
  - lib/rubocop/cop/lint/ensure_return.rb
234
153
  - lib/rubocop/cop/lint/eval.rb
154
+ - lib/rubocop/cop/lint/float_out_of_range.rb
235
155
  - lib/rubocop/cop/lint/format_parameter_mismatch.rb
236
156
  - lib/rubocop/cop/lint/handle_exceptions.rb
157
+ - lib/rubocop/cop/lint/implicit_string_concatenation.rb
158
+ - lib/rubocop/cop/lint/ineffective_access_modifier.rb
237
159
  - lib/rubocop/cop/lint/invalid_character_literal.rb
238
160
  - lib/rubocop/cop/lint/literal_in_condition.rb
239
161
  - lib/rubocop/cop/lint/literal_in_interpolation.rb
240
162
  - lib/rubocop/cop/lint/loop.rb
241
163
  - lib/rubocop/cop/lint/nested_method_definition.rb
164
+ - lib/rubocop/cop/lint/next_without_accumulator.rb
242
165
  - lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
243
166
  - lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
167
+ - lib/rubocop/cop/lint/rand_one.rb
244
168
  - lib/rubocop/cop/lint/require_parentheses.rb
245
169
  - lib/rubocop/cop/lint/rescue_exception.rb
246
170
  - lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
247
- - lib/rubocop/cop/lint/space_before_first_arg.rb
248
171
  - lib/rubocop/cop/lint/string_conversion_in_interpolation.rb
249
172
  - lib/rubocop/cop/lint/syntax.rb
250
173
  - lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
@@ -269,6 +192,7 @@ files:
269
192
  - lib/rubocop/cop/metrics/perceived_complexity.rb
270
193
  - lib/rubocop/cop/mixin/access_modifier_node.rb
271
194
  - lib/rubocop/cop/mixin/annotation_comment.rb
195
+ - lib/rubocop/cop/mixin/array_hash_indentation.rb
272
196
  - lib/rubocop/cop/mixin/array_syntax.rb
273
197
  - lib/rubocop/cop/mixin/autocorrect_alignment.rb
274
198
  - lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb
@@ -281,15 +205,19 @@ files:
281
205
  - lib/rubocop/cop/mixin/empty_lines_around_body.rb
282
206
  - lib/rubocop/cop/mixin/end_keyword_alignment.rb
283
207
  - lib/rubocop/cop/mixin/first_element_line_break.rb
208
+ - lib/rubocop/cop/mixin/hash_node.rb
284
209
  - lib/rubocop/cop/mixin/if_node.rb
285
210
  - lib/rubocop/cop/mixin/method_complexity.rb
286
211
  - lib/rubocop/cop/mixin/method_preference.rb
287
212
  - lib/rubocop/cop/mixin/min_body_length.rb
213
+ - lib/rubocop/cop/mixin/multiline_expression_indentation.rb
288
214
  - lib/rubocop/cop/mixin/negative_conditional.rb
289
215
  - lib/rubocop/cop/mixin/on_method_def.rb
290
216
  - lib/rubocop/cop/mixin/on_normal_if_unless.rb
217
+ - lib/rubocop/cop/mixin/parentheses.rb
291
218
  - lib/rubocop/cop/mixin/parser_diagnostic.rb
292
219
  - lib/rubocop/cop/mixin/percent_literal.rb
220
+ - lib/rubocop/cop/mixin/preceding_following_alignment.rb
293
221
  - lib/rubocop/cop/mixin/safe_assignment.rb
294
222
  - lib/rubocop/cop/mixin/space_after_punctuation.rb
295
223
  - lib/rubocop/cop/mixin/space_before_punctuation.rb
@@ -298,20 +226,32 @@ files:
298
226
  - lib/rubocop/cop/mixin/string_help.rb
299
227
  - lib/rubocop/cop/mixin/string_literals_help.rb
300
228
  - lib/rubocop/cop/mixin/surrounding_space.rb
229
+ - lib/rubocop/cop/mixin/trailing_comma.rb
301
230
  - lib/rubocop/cop/mixin/unused_argument.rb
302
231
  - lib/rubocop/cop/offense.rb
303
232
  - lib/rubocop/cop/performance/case_when_splat.rb
233
+ - lib/rubocop/cop/performance/casecmp.rb
304
234
  - lib/rubocop/cop/performance/count.rb
305
235
  - lib/rubocop/cop/performance/detect.rb
236
+ - lib/rubocop/cop/performance/double_start_end_with.rb
237
+ - lib/rubocop/cop/performance/end_with.rb
306
238
  - lib/rubocop/cop/performance/fixed_size.rb
307
239
  - lib/rubocop/cop/performance/flat_map.rb
240
+ - lib/rubocop/cop/performance/hash_each.rb
241
+ - lib/rubocop/cop/performance/lstrip_rstrip.rb
242
+ - lib/rubocop/cop/performance/range_include.rb
243
+ - lib/rubocop/cop/performance/redundant_block_call.rb
244
+ - lib/rubocop/cop/performance/redundant_match.rb
245
+ - lib/rubocop/cop/performance/redundant_merge.rb
246
+ - lib/rubocop/cop/performance/redundant_sort_by.rb
308
247
  - lib/rubocop/cop/performance/reverse_each.rb
309
248
  - lib/rubocop/cop/performance/sample.rb
310
249
  - lib/rubocop/cop/performance/size.rb
250
+ - lib/rubocop/cop/performance/start_with.rb
311
251
  - lib/rubocop/cop/performance/string_replacement.rb
252
+ - lib/rubocop/cop/performance/times_map.rb
312
253
  - lib/rubocop/cop/rails/action_filter.rb
313
254
  - lib/rubocop/cop/rails/date.rb
314
- - lib/rubocop/cop/rails/default_scope.rb
315
255
  - lib/rubocop/cop/rails/delegate.rb
316
256
  - lib/rubocop/cop/rails/find_by.rb
317
257
  - lib/rubocop/cop/rails/find_each.rb
@@ -355,6 +295,7 @@ files:
355
295
  - lib/rubocop/cop/style/command_literal.rb
356
296
  - lib/rubocop/cop/style/comment_annotation.rb
357
297
  - lib/rubocop/cop/style/comment_indentation.rb
298
+ - lib/rubocop/cop/style/conditional_assignment.rb
358
299
  - lib/rubocop/cop/style/constant_name.rb
359
300
  - lib/rubocop/cop/style/copyright.rb
360
301
  - lib/rubocop/cop/style/def_with_parentheses.rb
@@ -387,12 +328,16 @@ files:
387
328
  - lib/rubocop/cop/style/flip_flop.rb
388
329
  - lib/rubocop/cop/style/for.rb
389
330
  - lib/rubocop/cop/style/format_string.rb
331
+ - lib/rubocop/cop/style/frozen_string_literal_comment.rb
390
332
  - lib/rubocop/cop/style/global_vars.rb
391
333
  - lib/rubocop/cop/style/guard_clause.rb
392
334
  - lib/rubocop/cop/style/hash_syntax.rb
335
+ - lib/rubocop/cop/style/identical_conditional_branches.rb
336
+ - lib/rubocop/cop/style/if_inside_else.rb
393
337
  - lib/rubocop/cop/style/if_unless_modifier.rb
394
338
  - lib/rubocop/cop/style/if_with_semicolon.rb
395
339
  - lib/rubocop/cop/style/indent_array.rb
340
+ - lib/rubocop/cop/style/indent_assignment.rb
396
341
  - lib/rubocop/cop/style/indent_hash.rb
397
342
  - lib/rubocop/cop/style/indentation_consistency.rb
398
343
  - lib/rubocop/cop/style/indentation_width.rb
@@ -409,15 +354,19 @@ files:
409
354
  - lib/rubocop/cop/style/method_name.rb
410
355
  - lib/rubocop/cop/style/missing_else.rb
411
356
  - lib/rubocop/cop/style/module_function.rb
357
+ - lib/rubocop/cop/style/multiline_array_brace_layout.rb
358
+ - lib/rubocop/cop/style/multiline_assignment_layout.rb
412
359
  - lib/rubocop/cop/style/multiline_block_chain.rb
413
360
  - lib/rubocop/cop/style/multiline_block_layout.rb
414
361
  - lib/rubocop/cop/style/multiline_if_then.rb
362
+ - lib/rubocop/cop/style/multiline_method_call_indentation.rb
415
363
  - lib/rubocop/cop/style/multiline_operation_indentation.rb
416
364
  - lib/rubocop/cop/style/multiline_ternary_operator.rb
417
365
  - lib/rubocop/cop/style/mutable_constant.rb
418
366
  - lib/rubocop/cop/style/negated_if.rb
419
367
  - lib/rubocop/cop/style/negated_while.rb
420
368
  - lib/rubocop/cop/style/nested_modifier.rb
369
+ - lib/rubocop/cop/style/nested_parenthesized_calls.rb
421
370
  - lib/rubocop/cop/style/nested_ternary_operator.rb
422
371
  - lib/rubocop/cop/style/next.rb
423
372
  - lib/rubocop/cop/style/nil_comparison.rb
@@ -439,6 +388,7 @@ files:
439
388
  - lib/rubocop/cop/style/redundant_begin.rb
440
389
  - lib/rubocop/cop/style/redundant_exception.rb
441
390
  - lib/rubocop/cop/style/redundant_freeze.rb
391
+ - lib/rubocop/cop/style/redundant_parentheses.rb
442
392
  - lib/rubocop/cop/style/redundant_return.rb
443
393
  - lib/rubocop/cop/style/redundant_self.rb
444
394
  - lib/rubocop/cop/style/regexp_literal.rb
@@ -450,7 +400,6 @@ files:
450
400
  - lib/rubocop/cop/style/signal_exception.rb
451
401
  - lib/rubocop/cop/style/single_line_block_params.rb
452
402
  - lib/rubocop/cop/style/single_line_methods.rb
453
- - lib/rubocop/cop/style/single_space_before_first_arg.rb
454
403
  - lib/rubocop/cop/style/space_after_colon.rb
455
404
  - lib/rubocop/cop/style/space_after_comma.rb
456
405
  - lib/rubocop/cop/style/space_after_control_keyword.rb
@@ -463,6 +412,7 @@ files:
463
412
  - lib/rubocop/cop/style/space_before_block_braces.rb
464
413
  - lib/rubocop/cop/style/space_before_comma.rb
465
414
  - lib/rubocop/cop/style/space_before_comment.rb
415
+ - lib/rubocop/cop/style/space_before_first_arg.rb
466
416
  - lib/rubocop/cop/style/space_before_modifier_keyword.rb
467
417
  - lib/rubocop/cop/style/space_before_semicolon.rb
468
418
  - lib/rubocop/cop/style/space_inside_block_braces.rb
@@ -482,12 +432,14 @@ files:
482
432
  - lib/rubocop/cop/style/symbol_proc.rb
483
433
  - lib/rubocop/cop/style/tab.rb
484
434
  - lib/rubocop/cop/style/trailing_blank_lines.rb
485
- - lib/rubocop/cop/style/trailing_comma.rb
435
+ - lib/rubocop/cop/style/trailing_comma_in_arguments.rb
436
+ - lib/rubocop/cop/style/trailing_comma_in_literal.rb
486
437
  - lib/rubocop/cop/style/trailing_underscore_variable.rb
487
438
  - lib/rubocop/cop/style/trailing_whitespace.rb
488
439
  - lib/rubocop/cop/style/trivial_accessors.rb
489
440
  - lib/rubocop/cop/style/unless_else.rb
490
441
  - lib/rubocop/cop/style/unneeded_capital_w.rb
442
+ - lib/rubocop/cop/style/unneeded_interpolation.rb
491
443
  - lib/rubocop/cop/style/unneeded_percent_q.rb
492
444
  - lib/rubocop/cop/style/variable_interpolation.rb
493
445
  - lib/rubocop/cop/style/variable_name.rb
@@ -504,6 +456,7 @@ files:
504
456
  - lib/rubocop/cop/variable_force/scope.rb
505
457
  - lib/rubocop/cop/variable_force/variable.rb
506
458
  - lib/rubocop/cop/variable_force/variable_table.rb
459
+ - lib/rubocop/error.rb
507
460
  - lib/rubocop/formatter/base_formatter.rb
508
461
  - lib/rubocop/formatter/clang_style_formatter.rb
509
462
  - lib/rubocop/formatter/colorizable.rb
@@ -519,6 +472,8 @@ files:
519
472
  - lib/rubocop/formatter/progress_formatter.rb
520
473
  - lib/rubocop/formatter/simple_text_formatter.rb
521
474
  - lib/rubocop/formatter/text_util.rb
475
+ - lib/rubocop/formatter/worst_offenders_formatter.rb
476
+ - lib/rubocop/name_similarity.rb
522
477
  - lib/rubocop/node_pattern.rb
523
478
  - lib/rubocop/options.rb
524
479
  - lib/rubocop/path_util.rb
@@ -562,6 +517,7 @@ files:
562
517
  - relnotes/v0.34.1.md
563
518
  - relnotes/v0.34.2.md
564
519
  - relnotes/v0.35.0.md
520
+ - relnotes/v0.36.0.md
565
521
  - rubocop.gemspec
566
522
  homepage: http://github.com/bbatsov/rubocop
567
523
  licenses: