rubocop 0.43.0 → 0.44.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 (430) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/rubocop +0 -1
  4. data/config/default.yml +31 -0
  5. data/config/disabled.yml +6 -6
  6. data/config/enabled.yml +182 -140
  7. data/lib/rubocop.rb +7 -2
  8. data/lib/rubocop/ast_node.rb +0 -1
  9. data/lib/rubocop/ast_node/builder.rb +0 -1
  10. data/lib/rubocop/ast_node/sexp.rb +0 -1
  11. data/lib/rubocop/ast_node/traversal.rb +0 -1
  12. data/lib/rubocop/cached_data.rb +3 -20
  13. data/lib/rubocop/cli.rb +0 -1
  14. data/lib/rubocop/comment_config.rb +0 -1
  15. data/lib/rubocop/config.rb +0 -1
  16. data/lib/rubocop/config_loader.rb +1 -2
  17. data/lib/rubocop/config_loader_resolver.rb +0 -1
  18. data/lib/rubocop/config_store.rb +0 -1
  19. data/lib/rubocop/cop/autocorrect_logic.rb +0 -1
  20. data/lib/rubocop/cop/commissioner.rb +0 -1
  21. data/lib/rubocop/cop/cop.rb +15 -5
  22. data/lib/rubocop/cop/corrector.rb +0 -1
  23. data/lib/rubocop/cop/force.rb +0 -1
  24. data/lib/rubocop/cop/ignored_node.rb +0 -1
  25. data/lib/rubocop/cop/lint/ambiguous_operator.rb +0 -1
  26. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +0 -1
  27. data/lib/rubocop/cop/lint/assignment_in_condition.rb +2 -2
  28. data/lib/rubocop/cop/lint/block_alignment.rb +0 -1
  29. data/lib/rubocop/cop/lint/circular_argument_reference.rb +0 -1
  30. data/lib/rubocop/cop/lint/condition_position.rb +0 -1
  31. data/lib/rubocop/cop/lint/debugger.rb +0 -1
  32. data/lib/rubocop/cop/lint/def_end_alignment.rb +0 -1
  33. data/lib/rubocop/cop/lint/deprecated_class_methods.rb +0 -1
  34. data/lib/rubocop/cop/lint/duplicate_methods.rb +0 -1
  35. data/lib/rubocop/cop/lint/duplicated_key.rb +0 -1
  36. data/lib/rubocop/cop/lint/each_with_object_argument.rb +0 -1
  37. data/lib/rubocop/cop/lint/else_layout.rb +0 -1
  38. data/lib/rubocop/cop/lint/empty_ensure.rb +0 -1
  39. data/lib/rubocop/cop/lint/empty_interpolation.rb +0 -1
  40. data/lib/rubocop/cop/lint/end_alignment.rb +0 -1
  41. data/lib/rubocop/cop/lint/end_in_method.rb +0 -1
  42. data/lib/rubocop/cop/lint/ensure_return.rb +0 -1
  43. data/lib/rubocop/cop/lint/eval.rb +0 -1
  44. data/lib/rubocop/cop/lint/float_out_of_range.rb +0 -1
  45. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +0 -1
  46. data/lib/rubocop/cop/lint/handle_exceptions.rb +0 -1
  47. data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +0 -1
  48. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +0 -1
  49. data/lib/rubocop/cop/lint/inherit_exception.rb +0 -1
  50. data/lib/rubocop/cop/lint/invalid_character_literal.rb +0 -1
  51. data/lib/rubocop/cop/lint/literal_in_condition.rb +0 -1
  52. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +0 -1
  53. data/lib/rubocop/cop/lint/loop.rb +0 -1
  54. data/lib/rubocop/cop/lint/nested_method_definition.rb +0 -1
  55. data/lib/rubocop/cop/lint/next_without_accumulator.rb +0 -1
  56. data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +0 -1
  57. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +0 -1
  58. data/lib/rubocop/cop/lint/percent_string_array.rb +0 -1
  59. data/lib/rubocop/cop/lint/percent_symbol_array.rb +0 -1
  60. data/lib/rubocop/cop/lint/rand_one.rb +0 -1
  61. data/lib/rubocop/cop/lint/require_parentheses.rb +0 -1
  62. data/lib/rubocop/cop/lint/rescue_exception.rb +0 -1
  63. data/lib/rubocop/cop/lint/shadowed_exception.rb +1 -2
  64. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +0 -1
  65. data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +0 -1
  66. data/lib/rubocop/cop/lint/syntax.rb +0 -1
  67. data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +0 -1
  68. data/lib/rubocop/cop/lint/unified_integer.rb +0 -1
  69. data/lib/rubocop/cop/lint/unneeded_disable.rb +0 -1
  70. data/lib/rubocop/cop/lint/unneeded_splat_expansion.rb +15 -2
  71. data/lib/rubocop/cop/lint/unreachable_code.rb +0 -1
  72. data/lib/rubocop/cop/lint/unused_block_argument.rb +81 -27
  73. data/lib/rubocop/cop/lint/unused_method_argument.rb +0 -1
  74. data/lib/rubocop/cop/lint/useless_access_modifier.rb +0 -1
  75. data/lib/rubocop/cop/lint/useless_assignment.rb +0 -1
  76. data/lib/rubocop/cop/lint/useless_comparison.rb +0 -1
  77. data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +0 -1
  78. data/lib/rubocop/cop/lint/useless_setter_call.rb +0 -1
  79. data/lib/rubocop/cop/lint/void.rb +0 -1
  80. data/lib/rubocop/cop/metrics/abc_size.rb +1 -2
  81. data/lib/rubocop/cop/metrics/block_length.rb +26 -0
  82. data/lib/rubocop/cop/metrics/block_nesting.rb +0 -1
  83. data/lib/rubocop/cop/metrics/class_length.rb +0 -1
  84. data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +0 -1
  85. data/lib/rubocop/cop/metrics/line_length.rb +45 -8
  86. data/lib/rubocop/cop/metrics/method_length.rb +5 -10
  87. data/lib/rubocop/cop/metrics/module_length.rb +0 -1
  88. data/lib/rubocop/cop/metrics/parameter_lists.rb +0 -1
  89. data/lib/rubocop/cop/metrics/perceived_complexity.rb +0 -1
  90. data/lib/rubocop/cop/mixin/access_modifier_node.rb +0 -1
  91. data/lib/rubocop/cop/mixin/annotation_comment.rb +0 -1
  92. data/lib/rubocop/cop/mixin/array_hash_indentation.rb +0 -1
  93. data/lib/rubocop/cop/mixin/array_syntax.rb +0 -1
  94. data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +0 -1
  95. data/lib/rubocop/cop/mixin/check_assignment.rb +0 -1
  96. data/lib/rubocop/cop/mixin/classish_length.rb +0 -1
  97. data/lib/rubocop/cop/mixin/code_length.rb +1 -2
  98. data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +0 -1
  99. data/lib/rubocop/cop/mixin/configurable_max.rb +0 -1
  100. data/lib/rubocop/cop/mixin/configurable_naming.rb +0 -1
  101. data/lib/rubocop/cop/mixin/configurable_numbering.rb +2 -2
  102. data/lib/rubocop/cop/mixin/def_node.rb +0 -1
  103. data/lib/rubocop/cop/mixin/documentation_comment.rb +0 -1
  104. data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +41 -16
  105. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +0 -1
  106. data/lib/rubocop/cop/mixin/first_element_line_break.rb +0 -1
  107. data/lib/rubocop/cop/mixin/frozen_string_literal.rb +0 -1
  108. data/lib/rubocop/cop/mixin/hash_node.rb +0 -1
  109. data/lib/rubocop/cop/mixin/if_node.rb +0 -1
  110. data/lib/rubocop/cop/mixin/integer_node.rb +0 -1
  111. data/lib/rubocop/cop/mixin/match_range.rb +0 -1
  112. data/lib/rubocop/cop/mixin/method_complexity.rb +0 -1
  113. data/lib/rubocop/cop/mixin/method_preference.rb +0 -1
  114. data/lib/rubocop/cop/mixin/min_body_length.rb +0 -1
  115. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +0 -1
  116. data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +0 -1
  117. data/lib/rubocop/cop/mixin/negative_conditional.rb +0 -1
  118. data/lib/rubocop/cop/mixin/on_method_def.rb +0 -1
  119. data/lib/rubocop/cop/mixin/on_normal_if_unless.rb +0 -1
  120. data/lib/rubocop/cop/mixin/parentheses.rb +0 -1
  121. data/lib/rubocop/cop/mixin/parser_diagnostic.rb +0 -1
  122. data/lib/rubocop/cop/mixin/percent_literal.rb +0 -1
  123. data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +0 -1
  124. data/lib/rubocop/cop/mixin/safe_assignment.rb +0 -1
  125. data/lib/rubocop/cop/mixin/safe_mode.rb +0 -1
  126. data/lib/rubocop/cop/mixin/space_after_punctuation.rb +0 -1
  127. data/lib/rubocop/cop/mixin/space_before_punctuation.rb +0 -1
  128. data/lib/rubocop/cop/mixin/space_inside.rb +0 -1
  129. data/lib/rubocop/cop/mixin/statement_modifier.rb +0 -1
  130. data/lib/rubocop/cop/mixin/string_help.rb +0 -1
  131. data/lib/rubocop/cop/mixin/string_literals_help.rb +0 -1
  132. data/lib/rubocop/cop/mixin/surrounding_space.rb +0 -1
  133. data/lib/rubocop/cop/mixin/too_many_lines.rb +25 -0
  134. data/lib/rubocop/cop/mixin/trailing_comma.rb +1 -2
  135. data/lib/rubocop/cop/mixin/unused_argument.rb +0 -1
  136. data/lib/rubocop/cop/offense.rb +0 -1
  137. data/lib/rubocop/cop/performance/case_when_splat.rb +17 -8
  138. data/lib/rubocop/cop/performance/casecmp.rb +0 -1
  139. data/lib/rubocop/cop/performance/count.rb +0 -1
  140. data/lib/rubocop/cop/performance/detect.rb +0 -1
  141. data/lib/rubocop/cop/performance/double_start_end_with.rb +0 -1
  142. data/lib/rubocop/cop/performance/end_with.rb +0 -1
  143. data/lib/rubocop/cop/performance/fixed_size.rb +0 -1
  144. data/lib/rubocop/cop/performance/flat_map.rb +0 -1
  145. data/lib/rubocop/cop/performance/{hash_each.rb → hash_each_methods.rb} +0 -1
  146. data/lib/rubocop/cop/performance/lstrip_rstrip.rb +0 -1
  147. data/lib/rubocop/cop/performance/range_include.rb +0 -1
  148. data/lib/rubocop/cop/performance/redundant_block_call.rb +0 -1
  149. data/lib/rubocop/cop/performance/redundant_match.rb +0 -1
  150. data/lib/rubocop/cop/performance/redundant_merge.rb +1 -1
  151. data/lib/rubocop/cop/performance/redundant_sort_by.rb +0 -1
  152. data/lib/rubocop/cop/performance/reverse_each.rb +0 -1
  153. data/lib/rubocop/cop/performance/sample.rb +1 -2
  154. data/lib/rubocop/cop/performance/size.rb +0 -1
  155. data/lib/rubocop/cop/performance/sort_with_block.rb +0 -1
  156. data/lib/rubocop/cop/performance/start_with.rb +0 -1
  157. data/lib/rubocop/cop/performance/string_replacement.rb +0 -1
  158. data/lib/rubocop/cop/performance/times_map.rb +0 -1
  159. data/lib/rubocop/cop/rails/action_filter.rb +2 -3
  160. data/lib/rubocop/cop/rails/date.rb +0 -1
  161. data/lib/rubocop/cop/rails/delegate.rb +0 -1
  162. data/lib/rubocop/cop/rails/delegate_allow_blank.rb +62 -0
  163. data/lib/rubocop/cop/rails/dynamic_find_by.rb +77 -0
  164. data/lib/rubocop/cop/rails/exit.rb +0 -1
  165. data/lib/rubocop/cop/rails/find_by.rb +0 -1
  166. data/lib/rubocop/cop/rails/find_each.rb +0 -1
  167. data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +0 -1
  168. data/lib/rubocop/cop/rails/http_positional_arguments.rb +89 -0
  169. data/lib/rubocop/cop/rails/not_null_column.rb +1 -2
  170. data/lib/rubocop/cop/rails/output.rb +0 -1
  171. data/lib/rubocop/cop/rails/output_safety.rb +1 -2
  172. data/lib/rubocop/cop/rails/pluralization_grammar.rb +0 -1
  173. data/lib/rubocop/cop/rails/read_write_attribute.rb +0 -1
  174. data/lib/rubocop/cop/rails/request_referer.rb +0 -1
  175. data/lib/rubocop/cop/rails/safe_navigation.rb +0 -1
  176. data/lib/rubocop/cop/rails/save_bang.rb +12 -3
  177. data/lib/rubocop/cop/rails/scope_args.rb +0 -1
  178. data/lib/rubocop/cop/rails/time_zone.rb +0 -1
  179. data/lib/rubocop/cop/rails/uniq_before_pluck.rb +1 -2
  180. data/lib/rubocop/cop/rails/validation.rb +0 -1
  181. data/lib/rubocop/cop/security/json_load.rb +11 -3
  182. data/lib/rubocop/cop/severity.rb +0 -1
  183. data/lib/rubocop/cop/style/access_modifier_indentation.rb +0 -1
  184. data/lib/rubocop/cop/style/accessor_method_name.rb +0 -1
  185. data/lib/rubocop/cop/style/alias.rb +0 -1
  186. data/lib/rubocop/cop/style/align_array.rb +0 -1
  187. data/lib/rubocop/cop/style/align_hash.rb +0 -1
  188. data/lib/rubocop/cop/style/align_parameters.rb +0 -1
  189. data/lib/rubocop/cop/style/and_or.rb +0 -1
  190. data/lib/rubocop/cop/style/array_join.rb +0 -1
  191. data/lib/rubocop/cop/style/ascii_comments.rb +0 -1
  192. data/lib/rubocop/cop/style/ascii_identifiers.rb +0 -1
  193. data/lib/rubocop/cop/style/attr.rb +0 -1
  194. data/lib/rubocop/cop/style/auto_resource_cleanup.rb +0 -1
  195. data/lib/rubocop/cop/style/bare_percent_literals.rb +0 -1
  196. data/lib/rubocop/cop/style/begin_block.rb +0 -1
  197. data/lib/rubocop/cop/style/block_comments.rb +0 -1
  198. data/lib/rubocop/cop/style/block_delimiters.rb +0 -1
  199. data/lib/rubocop/cop/style/block_end_newline.rb +0 -1
  200. data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +0 -1
  201. data/lib/rubocop/cop/style/case_equality.rb +0 -1
  202. data/lib/rubocop/cop/style/case_indentation.rb +0 -1
  203. data/lib/rubocop/cop/style/character_literal.rb +0 -1
  204. data/lib/rubocop/cop/style/class_and_module_camel_case.rb +0 -1
  205. data/lib/rubocop/cop/style/class_and_module_children.rb +0 -1
  206. data/lib/rubocop/cop/style/class_check.rb +0 -1
  207. data/lib/rubocop/cop/style/class_methods.rb +0 -1
  208. data/lib/rubocop/cop/style/class_vars.rb +0 -1
  209. data/lib/rubocop/cop/style/closing_parenthesis_indentation.rb +0 -1
  210. data/lib/rubocop/cop/style/collection_methods.rb +0 -1
  211. data/lib/rubocop/cop/style/colon_method_call.rb +0 -1
  212. data/lib/rubocop/cop/style/command_literal.rb +0 -1
  213. data/lib/rubocop/cop/style/comment_annotation.rb +0 -1
  214. data/lib/rubocop/cop/style/comment_indentation.rb +0 -1
  215. data/lib/rubocop/cop/style/conditional_assignment.rb +0 -1
  216. data/lib/rubocop/cop/style/constant_name.rb +0 -1
  217. data/lib/rubocop/cop/style/copyright.rb +0 -1
  218. data/lib/rubocop/cop/style/def_with_parentheses.rb +0 -1
  219. data/lib/rubocop/cop/style/documentation.rb +0 -1
  220. data/lib/rubocop/cop/style/documentation_method.rb +0 -1
  221. data/lib/rubocop/cop/style/dot_position.rb +0 -1
  222. data/lib/rubocop/cop/style/double_negation.rb +0 -1
  223. data/lib/rubocop/cop/style/each_for_simple_loop.rb +0 -1
  224. data/lib/rubocop/cop/style/each_with_object.rb +0 -1
  225. data/lib/rubocop/cop/style/else_alignment.rb +0 -1
  226. data/lib/rubocop/cop/style/empty_case_condition.rb +0 -1
  227. data/lib/rubocop/cop/style/empty_else.rb +7 -6
  228. data/lib/rubocop/cop/style/empty_line_between_defs.rb +0 -1
  229. data/lib/rubocop/cop/style/empty_lines.rb +0 -1
  230. data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +15 -8
  231. data/lib/rubocop/cop/style/empty_lines_around_block_body.rb +0 -1
  232. data/lib/rubocop/cop/style/empty_lines_around_class_body.rb +0 -1
  233. data/lib/rubocop/cop/style/empty_lines_around_method_body.rb +0 -1
  234. data/lib/rubocop/cop/style/empty_lines_around_module_body.rb +0 -1
  235. data/lib/rubocop/cop/style/empty_literal.rb +0 -1
  236. data/lib/rubocop/cop/style/encoding.rb +0 -1
  237. data/lib/rubocop/cop/style/end_block.rb +0 -1
  238. data/lib/rubocop/cop/style/end_of_line.rb +0 -1
  239. data/lib/rubocop/cop/style/even_odd.rb +0 -1
  240. data/lib/rubocop/cop/style/extra_spacing.rb +5 -4
  241. data/lib/rubocop/cop/style/file_name.rb +0 -1
  242. data/lib/rubocop/cop/style/first_array_element_line_break.rb +0 -1
  243. data/lib/rubocop/cop/style/first_hash_element_line_break.rb +0 -1
  244. data/lib/rubocop/cop/style/first_method_argument_line_break.rb +0 -1
  245. data/lib/rubocop/cop/style/first_method_parameter_line_break.rb +0 -1
  246. data/lib/rubocop/cop/style/first_parameter_indentation.rb +0 -1
  247. data/lib/rubocop/cop/style/flip_flop.rb +0 -1
  248. data/lib/rubocop/cop/style/for.rb +0 -1
  249. data/lib/rubocop/cop/style/format_string.rb +0 -1
  250. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +0 -1
  251. data/lib/rubocop/cop/style/global_vars.rb +0 -1
  252. data/lib/rubocop/cop/style/guard_clause.rb +2 -4
  253. data/lib/rubocop/cop/style/hash_syntax.rb +0 -1
  254. data/lib/rubocop/cop/style/identical_conditional_branches.rb +0 -1
  255. data/lib/rubocop/cop/style/if_inside_else.rb +0 -1
  256. data/lib/rubocop/cop/style/if_unless_modifier.rb +0 -1
  257. data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +0 -1
  258. data/lib/rubocop/cop/style/if_with_semicolon.rb +0 -1
  259. data/lib/rubocop/cop/style/implicit_runtime_error.rb +0 -1
  260. data/lib/rubocop/cop/style/indent_array.rb +0 -1
  261. data/lib/rubocop/cop/style/indent_assignment.rb +0 -1
  262. data/lib/rubocop/cop/style/indent_hash.rb +0 -1
  263. data/lib/rubocop/cop/style/indentation_consistency.rb +0 -1
  264. data/lib/rubocop/cop/style/indentation_width.rb +0 -1
  265. data/lib/rubocop/cop/style/infinite_loop.rb +0 -1
  266. data/lib/rubocop/cop/style/initial_indentation.rb +0 -1
  267. data/lib/rubocop/cop/style/inline_comment.rb +0 -1
  268. data/lib/rubocop/cop/style/lambda.rb +0 -1
  269. data/lib/rubocop/cop/style/lambda_call.rb +0 -1
  270. data/lib/rubocop/cop/style/leading_comment_space.rb +0 -1
  271. data/lib/rubocop/cop/style/line_end_concatenation.rb +1 -2
  272. data/lib/rubocop/cop/style/method_call_parentheses.rb +0 -1
  273. data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +0 -1
  274. data/lib/rubocop/cop/style/method_def_parentheses.rb +0 -1
  275. data/lib/rubocop/cop/style/method_missing.rb +0 -1
  276. data/lib/rubocop/cop/style/method_name.rb +0 -1
  277. data/lib/rubocop/cop/style/missing_else.rb +0 -1
  278. data/lib/rubocop/cop/style/module_function.rb +0 -1
  279. data/lib/rubocop/cop/style/multiline_array_brace_layout.rb +0 -1
  280. data/lib/rubocop/cop/style/multiline_assignment_layout.rb +0 -1
  281. data/lib/rubocop/cop/style/multiline_block_chain.rb +0 -1
  282. data/lib/rubocop/cop/style/multiline_block_layout.rb +0 -1
  283. data/lib/rubocop/cop/style/multiline_hash_brace_layout.rb +0 -1
  284. data/lib/rubocop/cop/style/multiline_if_then.rb +0 -1
  285. data/lib/rubocop/cop/style/multiline_memoization.rb +44 -0
  286. data/lib/rubocop/cop/style/multiline_method_call_brace_layout.rb +0 -1
  287. data/lib/rubocop/cop/style/multiline_method_call_indentation.rb +0 -1
  288. data/lib/rubocop/cop/style/multiline_method_definition_brace_layout.rb +0 -1
  289. data/lib/rubocop/cop/style/multiline_operation_indentation.rb +0 -1
  290. data/lib/rubocop/cop/style/multiline_ternary_operator.rb +0 -1
  291. data/lib/rubocop/cop/style/mutable_constant.rb +0 -1
  292. data/lib/rubocop/cop/style/negated_if.rb +0 -1
  293. data/lib/rubocop/cop/style/negated_while.rb +0 -1
  294. data/lib/rubocop/cop/style/nested_modifier.rb +0 -1
  295. data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +0 -1
  296. data/lib/rubocop/cop/style/nested_ternary_operator.rb +0 -1
  297. data/lib/rubocop/cop/style/next.rb +0 -1
  298. data/lib/rubocop/cop/style/nil_comparison.rb +0 -1
  299. data/lib/rubocop/cop/style/non_nil_check.rb +18 -2
  300. data/lib/rubocop/cop/style/not.rb +0 -1
  301. data/lib/rubocop/cop/style/numeric_literal_prefix.rb +2 -5
  302. data/lib/rubocop/cop/style/numeric_literals.rb +0 -1
  303. data/lib/rubocop/cop/style/numeric_predicate.rb +0 -1
  304. data/lib/rubocop/cop/style/one_line_conditional.rb +0 -1
  305. data/lib/rubocop/cop/style/op_method.rb +0 -1
  306. data/lib/rubocop/cop/style/option_hash.rb +0 -1
  307. data/lib/rubocop/cop/style/optional_arguments.rb +0 -1
  308. data/lib/rubocop/cop/style/parallel_assignment.rb +13 -2
  309. data/lib/rubocop/cop/style/parentheses_around_condition.rb +0 -1
  310. data/lib/rubocop/cop/style/percent_literal_delimiters.rb +0 -1
  311. data/lib/rubocop/cop/style/percent_q_literals.rb +0 -1
  312. data/lib/rubocop/cop/style/perl_backrefs.rb +0 -1
  313. data/lib/rubocop/cop/style/predicate_name.rb +0 -1
  314. data/lib/rubocop/cop/style/preferred_hash_methods.rb +44 -6
  315. data/lib/rubocop/cop/style/proc.rb +0 -1
  316. data/lib/rubocop/cop/style/raise_args.rb +13 -14
  317. data/lib/rubocop/cop/style/redundant_begin.rb +0 -1
  318. data/lib/rubocop/cop/style/redundant_exception.rb +0 -1
  319. data/lib/rubocop/cop/style/redundant_freeze.rb +0 -1
  320. data/lib/rubocop/cop/style/redundant_parentheses.rb +2 -2
  321. data/lib/rubocop/cop/style/redundant_return.rb +37 -9
  322. data/lib/rubocop/cop/style/redundant_self.rb +0 -1
  323. data/lib/rubocop/cop/style/regexp_literal.rb +0 -1
  324. data/lib/rubocop/cop/style/rescue_ensure_alignment.rb +0 -1
  325. data/lib/rubocop/cop/style/rescue_modifier.rb +0 -1
  326. data/lib/rubocop/cop/style/safe_navigation.rb +51 -39
  327. data/lib/rubocop/cop/style/self_assignment.rb +0 -1
  328. data/lib/rubocop/cop/style/semicolon.rb +0 -1
  329. data/lib/rubocop/cop/style/send.rb +0 -1
  330. data/lib/rubocop/cop/style/signal_exception.rb +0 -1
  331. data/lib/rubocop/cop/style/single_line_block_params.rb +0 -1
  332. data/lib/rubocop/cop/style/single_line_methods.rb +0 -1
  333. data/lib/rubocop/cop/style/space_after_colon.rb +0 -1
  334. data/lib/rubocop/cop/style/space_after_comma.rb +0 -1
  335. data/lib/rubocop/cop/style/space_after_method_name.rb +0 -1
  336. data/lib/rubocop/cop/style/space_after_not.rb +0 -1
  337. data/lib/rubocop/cop/style/space_after_semicolon.rb +0 -1
  338. data/lib/rubocop/cop/style/space_around_block_parameters.rb +0 -1
  339. data/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +0 -1
  340. data/lib/rubocop/cop/style/space_around_keyword.rb +0 -1
  341. data/lib/rubocop/cop/style/space_around_operators.rb +0 -1
  342. data/lib/rubocop/cop/style/space_before_block_braces.rb +0 -1
  343. data/lib/rubocop/cop/style/space_before_comma.rb +0 -1
  344. data/lib/rubocop/cop/style/space_before_comment.rb +0 -1
  345. data/lib/rubocop/cop/style/space_before_first_arg.rb +0 -1
  346. data/lib/rubocop/cop/style/space_before_semicolon.rb +0 -1
  347. data/lib/rubocop/cop/style/space_inside_array_percent_literal.rb +0 -1
  348. data/lib/rubocop/cop/style/space_inside_block_braces.rb +0 -1
  349. data/lib/rubocop/cop/style/space_inside_brackets.rb +0 -1
  350. data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +0 -1
  351. data/lib/rubocop/cop/style/space_inside_parens.rb +0 -1
  352. data/lib/rubocop/cop/style/space_inside_percent_literal_delimiters.rb +0 -1
  353. data/lib/rubocop/cop/style/space_inside_range_literal.rb +0 -1
  354. data/lib/rubocop/cop/style/space_inside_string_interpolation.rb +0 -1
  355. data/lib/rubocop/cop/style/special_global_vars.rb +0 -1
  356. data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +0 -1
  357. data/lib/rubocop/cop/style/string_literals.rb +0 -1
  358. data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +0 -1
  359. data/lib/rubocop/cop/style/string_methods.rb +0 -1
  360. data/lib/rubocop/cop/style/struct_inheritance.rb +0 -1
  361. data/lib/rubocop/cop/style/symbol_array.rb +0 -1
  362. data/lib/rubocop/cop/style/symbol_literal.rb +0 -1
  363. data/lib/rubocop/cop/style/symbol_proc.rb +0 -1
  364. data/lib/rubocop/cop/style/tab.rb +0 -1
  365. data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -2
  366. data/lib/rubocop/cop/style/trailing_blank_lines.rb +0 -1
  367. data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +0 -1
  368. data/lib/rubocop/cop/style/trailing_comma_in_literal.rb +0 -1
  369. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +0 -1
  370. data/lib/rubocop/cop/style/trailing_whitespace.rb +0 -1
  371. data/lib/rubocop/cop/style/trivial_accessors.rb +0 -1
  372. data/lib/rubocop/cop/style/unless_else.rb +0 -1
  373. data/lib/rubocop/cop/style/unneeded_capital_w.rb +3 -2
  374. data/lib/rubocop/cop/style/unneeded_interpolation.rb +0 -1
  375. data/lib/rubocop/cop/style/unneeded_percent_q.rb +0 -1
  376. data/lib/rubocop/cop/style/variable_interpolation.rb +0 -1
  377. data/lib/rubocop/cop/style/variable_name.rb +0 -1
  378. data/lib/rubocop/cop/style/variable_number.rb +0 -1
  379. data/lib/rubocop/cop/style/when_then.rb +0 -1
  380. data/lib/rubocop/cop/style/while_until_do.rb +0 -1
  381. data/lib/rubocop/cop/style/while_until_modifier.rb +0 -1
  382. data/lib/rubocop/cop/style/word_array.rb +0 -1
  383. data/lib/rubocop/cop/style/zero_length_predicate.rb +0 -1
  384. data/lib/rubocop/cop/team.rb +1 -2
  385. data/lib/rubocop/cop/util.rb +11 -6
  386. data/lib/rubocop/cop/variable_force.rb +0 -1
  387. data/lib/rubocop/cop/variable_force/assignment.rb +0 -1
  388. data/lib/rubocop/cop/variable_force/locatable.rb +0 -1
  389. data/lib/rubocop/cop/variable_force/reference.rb +0 -1
  390. data/lib/rubocop/cop/variable_force/scope.rb +0 -1
  391. data/lib/rubocop/cop/variable_force/variable.rb +0 -1
  392. data/lib/rubocop/cop/variable_force/variable_table.rb +0 -1
  393. data/lib/rubocop/error.rb +0 -1
  394. data/lib/rubocop/formatter/base_formatter.rb +0 -1
  395. data/lib/rubocop/formatter/clang_style_formatter.rb +0 -1
  396. data/lib/rubocop/formatter/colorizable.rb +0 -1
  397. data/lib/rubocop/formatter/disabled_config_formatter.rb +0 -1
  398. data/lib/rubocop/formatter/disabled_lines_formatter.rb +0 -1
  399. data/lib/rubocop/formatter/emacs_style_formatter.rb +0 -1
  400. data/lib/rubocop/formatter/file_list_formatter.rb +0 -1
  401. data/lib/rubocop/formatter/formatter_set.rb +0 -1
  402. data/lib/rubocop/formatter/fuubar_style_formatter.rb +0 -1
  403. data/lib/rubocop/formatter/html_formatter.rb +2 -3
  404. data/lib/rubocop/formatter/json_formatter.rb +0 -1
  405. data/lib/rubocop/formatter/offense_count_formatter.rb +0 -1
  406. data/lib/rubocop/formatter/progress_formatter.rb +0 -1
  407. data/lib/rubocop/formatter/simple_text_formatter.rb +0 -1
  408. data/lib/rubocop/formatter/text_util.rb +0 -1
  409. data/lib/rubocop/formatter/worst_offenders_formatter.rb +0 -1
  410. data/lib/rubocop/name_similarity.rb +0 -1
  411. data/lib/rubocop/node_pattern.rb +0 -1
  412. data/lib/rubocop/options.rb +0 -1
  413. data/lib/rubocop/path_util.rb +0 -1
  414. data/lib/rubocop/processed_source.rb +3 -4
  415. data/lib/rubocop/rake_task.rb +0 -1
  416. data/lib/rubocop/remote_config.rb +0 -1
  417. data/lib/rubocop/result_cache.rb +3 -4
  418. data/lib/rubocop/rspec/cop_helper.rb +0 -1
  419. data/lib/rubocop/rspec/host_environment_simulation_helper.rb +0 -1
  420. data/lib/rubocop/rspec/shared_contexts.rb +0 -1
  421. data/lib/rubocop/rspec/shared_examples.rb +0 -1
  422. data/lib/rubocop/rspec/support.rb +0 -1
  423. data/lib/rubocop/runner.rb +0 -1
  424. data/lib/rubocop/string_interpreter.rb +0 -1
  425. data/lib/rubocop/string_util.rb +0 -1
  426. data/lib/rubocop/target_finder.rb +0 -1
  427. data/lib/rubocop/token.rb +0 -1
  428. data/lib/rubocop/version.rb +1 -2
  429. data/lib/rubocop/warning.rb +0 -1
  430. metadata +9 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a3cab88e12da31681ef92d0b6f51398cf80b923
4
- data.tar.gz: 1e86c53747471bba3288f3c50d58c5ff00cd6e8d
3
+ metadata.gz: 1631a5c10e3bd5546d7b4a55a63148fabaacf058
4
+ data.tar.gz: c7e8faab79e7dabafb495fb1037298b6b3785b3e
5
5
  SHA512:
6
- metadata.gz: 16e14107016b4b1317715a5fa4aaf69292f3ba3b58f24f894b8967fd8e8e9762070c7a589b1ca887bdb1f82c631f8b5f240cc2e57c4e580e08ce83813abf9907
7
- data.tar.gz: 6629b87681d63b954c4e24f23a44bf16226a8aa1222be8320cd09b750340416b95f0654c121bfda5867b4ad4fe69bb5996af63e86a84632bdf21055ea8e649b1
6
+ metadata.gz: 59371070490a54dba2fc417cb1d00d45eab85e407d9cacf6d457f652ae5721619bfcb891f980f3446dc72a902104afb1da9c7ee022d44f5cab6fdae17dc9ad12
7
+ data.tar.gz: eeb000ca52cac9ed4aaec1185444bb8af0928711fceba785c77dfea1e6d512a773cf489d56fa782bab1bb56726ae35e45b56b64ac3d6223bc35b27a40516e799
data/README.md CHANGED
@@ -51,7 +51,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
51
51
  might want to use a conservative version locking in your `Gemfile`:
52
52
 
53
53
  ```rb
54
- gem 'rubocop', '~> 0.43.0', require: false
54
+ gem 'rubocop', '~> 0.44.0', require: false
55
55
  ```
56
56
 
57
57
  ## Quickstart
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  $LOAD_PATH.unshift(File.dirname(File.realpath(__FILE__)) + '/../lib')
@@ -39,6 +39,9 @@ AllCops:
39
39
  # behavior by overriding DisplayStyleGuide, or by giving the
40
40
  # -S/--display-style-guide option.
41
41
  DisplayStyleGuide: false
42
+ # When specifying style guide URLs, any paths and/or fragments will be
43
+ # evaluated relative to the base URL.
44
+ StyleGuideBaseURL: https://github.com/bbatsov/ruby-style-guide
42
45
  # Extra details are not displayed in offense messages by default. Change
43
46
  # behavior by overriding ExtraDetails, or by giving the
44
47
  # -E/--extra-details option.
@@ -432,12 +435,14 @@ Style/EmptyLinesAroundClassBody:
432
435
  EnforcedStyle: no_empty_lines
433
436
  SupportedStyles:
434
437
  - empty_lines
438
+ - empty_lines_except_namespace
435
439
  - no_empty_lines
436
440
 
437
441
  Style/EmptyLinesAroundModuleBody:
438
442
  EnforcedStyle: no_empty_lines
439
443
  SupportedStyles:
440
444
  - empty_lines
445
+ - empty_lines_except_namespace
441
446
  - no_empty_lines
442
447
 
443
448
  # Checks whether the source file has a utf-8 encoding comment or not
@@ -817,6 +822,12 @@ Style/PredicateName:
817
822
  Exclude:
818
823
  - 'spec/**/*'
819
824
 
825
+ Style/PreferredHashMethods:
826
+ EnforcedStyle: short
827
+ SupportedStyles:
828
+ - short
829
+ - verbose
830
+
820
831
  Style/RaiseArgs:
821
832
  EnforcedStyle: exploded
822
833
  SupportedStyles:
@@ -841,6 +852,11 @@ Style/RegexpLiteral:
841
852
  # are found in the regexp string.
842
853
  AllowInnerSlashes: false
843
854
 
855
+ Style/SafeNavigation:
856
+ # Safe navigation may cause a statement to start returning `nil` in addition
857
+ # to whatever it used to return.
858
+ ConvertCodeThatCanStartToReturnNil: false
859
+
844
860
  Style/Semicolon:
845
861
  # Allow ; to separate several expressions on the same line.
846
862
  AllowAsExpressionSeparator: false
@@ -1109,11 +1125,22 @@ Metrics/LineLength:
1109
1125
  URISchemes:
1110
1126
  - http
1111
1127
  - https
1128
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1129
+ # directives like '# rubocop: enable ...' when calculating a line's length.
1130
+ IgnoreCopDirectives: false
1112
1131
 
1113
1132
  Metrics/MethodLength:
1114
1133
  CountComments: false # count full line comments?
1115
1134
  Max: 10
1116
1135
 
1136
+ Metrics/BlockLength:
1137
+ CountComments: false # count full line comments?
1138
+ Max: 25
1139
+ Exclude:
1140
+ - 'Rakefile'
1141
+ - '**/*.rake'
1142
+ - 'spec/**/*.rb'
1143
+
1117
1144
  Metrics/ParameterLists:
1118
1145
  Max: 5
1119
1146
  CountKeywordArgs: true
@@ -1211,6 +1238,10 @@ Rails/Date:
1211
1238
  - strict
1212
1239
  - flexible
1213
1240
 
1241
+ Rails/DynamicFindBy:
1242
+ Whitelist:
1243
+ - find_by_sql
1244
+
1214
1245
  Rails/Exit:
1215
1246
  Include:
1216
1247
  - app/**/*.rb
@@ -16,7 +16,7 @@ Style/AutoResourceCleanup:
16
16
 
17
17
  Style/CollectionMethods:
18
18
  Description: 'Preferred collection methods.'
19
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size'
19
+ StyleGuide: '#map-find-select-reduce-size'
20
20
  Enabled: false
21
21
 
22
22
  Style/Copyright:
@@ -32,7 +32,7 @@ Style/DocumentationMethod:
32
32
 
33
33
  Style/Encoding:
34
34
  Description: 'Use UTF-8 as the source file encoding.'
35
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#utf-8'
35
+ StyleGuide: '#utf-8'
36
36
  Enabled: false
37
37
 
38
38
  Style/FirstArrayElementLineBreak:
@@ -71,7 +71,7 @@ Style/InlineComment:
71
71
 
72
72
  Style/MethodCalledOnDoEndBlock:
73
73
  Description: 'Avoid chaining a method call on a do...end block.'
74
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
74
+ StyleGuide: '#single-line-blocks'
75
75
  Enabled: false
76
76
 
77
77
  Style/MissingElse:
@@ -93,7 +93,7 @@ Style/MissingElse:
93
93
 
94
94
  Style/MultilineAssignmentLayout:
95
95
  Description: 'Check for a newline after the assignment operator in multi-line assignments.'
96
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-conditional-assignment'
96
+ StyleGuide: '#indent-conditional-assignment'
97
97
  Enabled: false
98
98
 
99
99
  Style/OptionHash:
@@ -102,7 +102,7 @@ Style/OptionHash:
102
102
 
103
103
  Style/Send:
104
104
  Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
105
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#prefer-public-send'
105
+ StyleGuide: '#prefer-public-send'
106
106
  Enabled: false
107
107
 
108
108
  Style/StringMethods:
@@ -111,5 +111,5 @@ Style/StringMethods:
111
111
 
112
112
  Style/SymbolArray:
113
113
  Description: 'Use %i or %I for arrays of symbols.'
114
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
114
+ StyleGuide: '#percent-i'
115
115
  Enabled: false
@@ -2,24 +2,24 @@
2
2
 
3
3
  Style/AccessModifierIndentation:
4
4
  Description: Check indentation of private/protected visibility modifiers.
5
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
5
+ StyleGuide: '#indent-public-private-protected'
6
6
  Enabled: true
7
7
 
8
8
  Style/AccessorMethodName:
9
9
  Description: Check the naming of accessor methods for get_/set_.
10
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#accessor_mutator_method_names'
10
+ StyleGuide: '#accessor_mutator_method_names'
11
11
  Enabled: true
12
12
 
13
13
  Style/Alias:
14
14
  Description: 'Use alias instead of alias_method.'
15
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
15
+ StyleGuide: '#alias-method'
16
16
  Enabled: true
17
17
 
18
18
  Style/AlignArray:
19
19
  Description: >-
20
20
  Align the elements of an array literal if they span more than
21
21
  one line.
22
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
22
+ StyleGuide: '#align-multiline-arrays'
23
23
  Enabled: true
24
24
 
25
25
  Style/AlignHash:
@@ -32,47 +32,47 @@ Style/AlignParameters:
32
32
  Description: >-
33
33
  Align the parameters of a method call if they span more
34
34
  than one line.
35
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
35
+ StyleGuide: '#no-double-indent'
36
36
  Enabled: true
37
37
 
38
38
  Style/AndOr:
39
39
  Description: 'Use &&/|| instead of and/or.'
40
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
40
+ StyleGuide: '#no-and-or-or'
41
41
  Enabled: true
42
42
 
43
43
  Style/ArrayJoin:
44
44
  Description: 'Use Array#join instead of Array#*.'
45
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
45
+ StyleGuide: '#array-join'
46
46
  Enabled: true
47
47
 
48
48
  Style/AsciiComments:
49
49
  Description: 'Use only ascii symbols in comments.'
50
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
50
+ StyleGuide: '#english-comments'
51
51
  Enabled: true
52
52
 
53
53
  Style/AsciiIdentifiers:
54
54
  Description: 'Use only ascii symbols in identifiers.'
55
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
55
+ StyleGuide: '#english-identifiers'
56
56
  Enabled: true
57
57
 
58
58
  Style/Attr:
59
59
  Description: 'Checks for uses of Module#attr.'
60
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
60
+ StyleGuide: '#attr'
61
61
  Enabled: true
62
62
 
63
63
  Style/BeginBlock:
64
64
  Description: 'Avoid the use of BEGIN blocks.'
65
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
65
+ StyleGuide: '#no-BEGIN-blocks'
66
66
  Enabled: true
67
67
 
68
68
  Style/BarePercentLiterals:
69
69
  Description: 'Checks if usage of %() or %Q() matches configuration.'
70
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
70
+ StyleGuide: '#percent-q-shorthand'
71
71
  Enabled: true
72
72
 
73
73
  Style/BlockComments:
74
74
  Description: 'Do not use block comments.'
75
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
75
+ StyleGuide: '#no-block-comments'
76
76
  Enabled: true
77
77
 
78
78
  Style/BlockEndNewline:
@@ -84,7 +84,7 @@ Style/BlockDelimiters:
84
84
  Avoid using {...} for multi-line blocks (multiline chaining is
85
85
  always ugly).
86
86
  Prefer {...} over do...end for single-line blocks.
87
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
87
+ StyleGuide: '#single-line-blocks'
88
88
  Enabled: true
89
89
 
90
90
  Style/BracesAroundHashParameters:
@@ -93,22 +93,22 @@ Style/BracesAroundHashParameters:
93
93
 
94
94
  Style/CaseEquality:
95
95
  Description: 'Avoid explicit use of the case equality operator(===).'
96
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
96
+ StyleGuide: '#no-case-equality'
97
97
  Enabled: true
98
98
 
99
99
  Style/CaseIndentation:
100
100
  Description: 'Indentation of when in a case/when/[else/]end.'
101
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
101
+ StyleGuide: '#indent-when-to-case'
102
102
  Enabled: true
103
103
 
104
104
  Style/CharacterLiteral:
105
105
  Description: 'Checks for uses of character literals.'
106
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
106
+ StyleGuide: '#no-character-literals'
107
107
  Enabled: true
108
108
 
109
109
  Style/ClassAndModuleCamelCase:
110
110
  Description: 'Use CamelCase for classes and modules.'
111
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
111
+ StyleGuide: '#camelcase-classes'
112
112
  Enabled: true
113
113
 
114
114
  Style/ClassAndModuleChildren:
@@ -121,12 +121,12 @@ Style/ClassCheck:
121
121
 
122
122
  Style/ClassMethods:
123
123
  Description: 'Use self when defining module/class methods.'
124
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
124
+ StyleGuide: '#def-self-class-methods'
125
125
  Enabled: true
126
126
 
127
127
  Style/ClassVars:
128
128
  Description: 'Avoid the use of class variables.'
129
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
129
+ StyleGuide: '#no-class-vars'
130
130
  Enabled: true
131
131
 
132
132
  Style/ClosingParenthesisIndentation:
@@ -135,19 +135,19 @@ Style/ClosingParenthesisIndentation:
135
135
 
136
136
  Style/ColonMethodCall:
137
137
  Description: 'Do not use :: for method call.'
138
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
138
+ StyleGuide: '#double-colons'
139
139
  Enabled: true
140
140
 
141
141
  Style/CommandLiteral:
142
142
  Description: 'Use `` or %x around command literals.'
143
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
143
+ StyleGuide: '#percent-x'
144
144
  Enabled: true
145
145
 
146
146
  Style/CommentAnnotation:
147
147
  Description: >-
148
148
  Checks formatting of special comments
149
149
  (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
150
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
150
+ StyleGuide: '#annotate-keywords'
151
151
  Enabled: true
152
152
 
153
153
  Style/CommentIndentation:
@@ -163,17 +163,12 @@ Style/ConditionalAssignment:
163
163
 
164
164
  Style/ConstantName:
165
165
  Description: 'Constants should use SCREAMING_SNAKE_CASE.'
166
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
166
+ StyleGuide: '#screaming-snake-case'
167
167
  Enabled: true
168
168
 
169
169
  Style/DefWithParentheses:
170
170
  Description: 'Use def with parentheses when there are arguments.'
171
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
172
- Enabled: true
173
-
174
- Style/PreferredHashMethods:
175
- Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
176
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
171
+ StyleGuide: '#method-parens'
177
172
  Enabled: true
178
173
 
179
174
  Style/Documentation:
@@ -185,12 +180,12 @@ Style/Documentation:
185
180
 
186
181
  Style/DotPosition:
187
182
  Description: 'Checks the position of the dot in multi-line method calls.'
188
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
183
+ StyleGuide: '#consistent-multi-line-chains'
189
184
  Enabled: true
190
185
 
191
186
  Style/DoubleNegation:
192
187
  Description: 'Checks for uses of double negation (!!).'
193
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
188
+ StyleGuide: '#no-bang-bang'
194
189
  Enabled: true
195
190
 
196
191
  Style/EachForSimpleLoop:
@@ -217,7 +212,7 @@ Style/EmptyCaseCondition:
217
212
 
218
213
  Style/EmptyLineBetweenDefs:
219
214
  Description: 'Use empty lines between defs.'
220
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
215
+ StyleGuide: '#empty-lines-between-methods'
221
216
  Enabled: true
222
217
 
223
218
  Style/EmptyLines:
@@ -246,22 +241,22 @@ Style/EmptyLinesAroundMethodBody:
246
241
 
247
242
  Style/EmptyLiteral:
248
243
  Description: 'Prefer literals to Array.new/Hash.new/String.new.'
249
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
244
+ StyleGuide: '#literal-array-hash'
250
245
  Enabled: true
251
246
 
252
247
  Style/EndBlock:
253
248
  Description: 'Avoid the use of END blocks.'
254
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
249
+ StyleGuide: '#no-END-blocks'
255
250
  Enabled: true
256
251
 
257
252
  Style/EndOfLine:
258
253
  Description: 'Use Unix-style line endings.'
259
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
254
+ StyleGuide: '#crlf'
260
255
  Enabled: true
261
256
 
262
257
  Style/EvenOdd:
263
258
  Description: 'Favor the use of Integer#even? && Integer#odd?'
264
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
259
+ StyleGuide: '#predicate-methods'
265
260
  Enabled: true
266
261
 
267
262
  Style/ExtraSpacing:
@@ -270,7 +265,7 @@ Style/ExtraSpacing:
270
265
 
271
266
  Style/FileName:
272
267
  Description: 'Use snake_case for source file names.'
273
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
268
+ StyleGuide: '#snake-case-files'
274
269
  Enabled: true
275
270
 
276
271
  Style/FrozenStringLiteralComment:
@@ -290,35 +285,35 @@ Style/FirstParameterIndentation:
290
285
 
291
286
  Style/FlipFlop:
292
287
  Description: 'Checks for flip flops'
293
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
288
+ StyleGuide: '#no-flip-flops'
294
289
  Enabled: true
295
290
 
296
291
  Style/For:
297
292
  Description: 'Checks use of for or each in multiline loops.'
298
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
293
+ StyleGuide: '#no-for-loops'
299
294
  Enabled: true
300
295
 
301
296
  Style/FormatString:
302
297
  Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
303
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
298
+ StyleGuide: '#sprintf'
304
299
  Enabled: true
305
300
 
306
301
  Style/GlobalVars:
307
302
  Description: 'Do not introduce global variables.'
308
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
303
+ StyleGuide: '#instance-vars'
309
304
  Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
310
305
  Enabled: true
311
306
 
312
307
  Style/GuardClause:
313
308
  Description: 'Check for conditionals that can be replaced with guard clauses'
314
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
309
+ StyleGuide: '#no-nested-conditionals'
315
310
  Enabled: true
316
311
 
317
312
  Style/HashSyntax:
318
313
  Description: >-
319
314
  Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
320
315
  { :a => 1, :b => 2 }.
321
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
316
+ StyleGuide: '#hash-literals'
322
317
  Enabled: true
323
318
 
324
319
  Style/IfInsideElse:
@@ -329,7 +324,7 @@ Style/IfUnlessModifier:
329
324
  Description: >-
330
325
  Favor modifier if/unless usage when you have a
331
326
  single-line body.
332
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
327
+ StyleGuide: '#if-as-a-modifier'
333
328
  Enabled: true
334
329
 
335
330
  Style/IfUnlessModifierOfIfUnless:
@@ -339,7 +334,7 @@ Style/IfUnlessModifierOfIfUnless:
339
334
 
340
335
  Style/IfWithSemicolon:
341
336
  Description: 'Do not use if x; .... Use the ternary operator instead.'
342
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
337
+ StyleGuide: '#no-semicolon-ifs'
343
338
  Enabled: true
344
339
 
345
340
  Style/IndentationConsistency:
@@ -348,7 +343,7 @@ Style/IndentationConsistency:
348
343
 
349
344
  Style/IndentationWidth:
350
345
  Description: 'Use 2 spaces for indentation.'
351
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
346
+ StyleGuide: '#spaces-indentation'
352
347
  Enabled: true
353
348
 
354
349
  Style/IdenticalConditionalBranches:
@@ -376,22 +371,22 @@ Style/IndentHash:
376
371
 
377
372
  Style/InfiniteLoop:
378
373
  Description: 'Use Kernel#loop for infinite loops.'
379
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
374
+ StyleGuide: '#infinite-loop'
380
375
  Enabled: true
381
376
 
382
377
  Style/Lambda:
383
378
  Description: 'Use the new lambda literal syntax for single-line blocks.'
384
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
379
+ StyleGuide: '#lambda-multi-line'
385
380
  Enabled: true
386
381
 
387
382
  Style/LambdaCall:
388
383
  Description: 'Use lambda.call(...) instead of lambda.(...).'
389
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
384
+ StyleGuide: '#proc-call'
390
385
  Enabled: true
391
386
 
392
387
  Style/LeadingCommentSpace:
393
388
  Description: 'Comments should start with a space.'
394
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
389
+ StyleGuide: '#hash-space'
395
390
  Enabled: true
396
391
 
397
392
  Style/LineEndConcatenation:
@@ -402,29 +397,29 @@ Style/LineEndConcatenation:
402
397
 
403
398
  Style/MethodCallParentheses:
404
399
  Description: 'Do not use parentheses for method calls with no arguments.'
405
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-invocation-parens'
400
+ StyleGuide: '#method-invocation-parens'
406
401
  Enabled: true
407
402
 
408
403
  Style/MethodDefParentheses:
409
404
  Description: >-
410
405
  Checks if the method definitions have or don't have
411
406
  parentheses.
412
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
407
+ StyleGuide: '#method-parens'
413
408
  Enabled: true
414
409
 
415
410
  Style/MethodName:
416
411
  Description: 'Use the configured style when naming methods.'
417
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
412
+ StyleGuide: '#snake-case-symbols-methods-vars'
418
413
  Enabled: true
419
414
 
420
415
  Style/MethodMissing:
421
416
  Description: 'Avoid using `method_missing`.'
422
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-method-missing'
417
+ StyleGuide: '#no-method-missing'
423
418
  Enabled: true
424
419
 
425
420
  Style/ModuleFunction:
426
421
  Description: 'Checks for usage of `extend self` in modules.'
427
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
422
+ StyleGuide: '#module-function'
428
423
  Enabled: true
429
424
 
430
425
  Style/MultilineArrayBraceLayout:
@@ -436,7 +431,7 @@ Style/MultilineArrayBraceLayout:
436
431
 
437
432
  Style/MultilineBlockChain:
438
433
  Description: 'Avoid multi-line chains of blocks.'
439
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
434
+ StyleGuide: '#single-line-blocks'
440
435
  Enabled: true
441
436
 
442
437
  Style/MultilineBlockLayout:
@@ -452,7 +447,11 @@ Style/MultilineHashBraceLayout:
452
447
 
453
448
  Style/MultilineIfThen:
454
449
  Description: 'Do not use then for multi-line if/unless.'
455
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
450
+ StyleGuide: '#no-then'
451
+ Enabled: true
452
+
453
+ Style/MultilineMemoization:
454
+ Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
456
455
  Enabled: true
457
456
 
458
457
  Style/MultilineMethodCallBraceLayout:
@@ -485,7 +484,7 @@ Style/MultilineTernaryOperator:
485
484
  Description: >-
486
485
  Avoid multi-line ?: (the ternary operator);
487
486
  use if/unless instead.
488
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
487
+ StyleGuide: '#no-multiline-ternary'
489
488
  Enabled: true
490
489
 
491
490
  Style/MutableConstant:
@@ -496,17 +495,17 @@ Style/NegatedIf:
496
495
  Description: >-
497
496
  Favor unless over if for negative conditions
498
497
  (or control flow or).
499
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
498
+ StyleGuide: '#unless-for-negatives'
500
499
  Enabled: true
501
500
 
502
501
  Style/NegatedWhile:
503
502
  Description: 'Favor until over while for negative conditions.'
504
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
503
+ StyleGuide: '#until-for-negatives'
505
504
  Enabled: true
506
505
 
507
506
  Style/NestedModifier:
508
507
  Description: 'Avoid using nested modifiers.'
509
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers'
508
+ StyleGuide: '#no-nested-modifiers'
510
509
  Enabled: true
511
510
 
512
511
  Style/NestedParenthesizedCalls:
@@ -517,65 +516,69 @@ Style/NestedParenthesizedCalls:
517
516
 
518
517
  Style/NestedTernaryOperator:
519
518
  Description: 'Use one expression per branch in a ternary operator.'
520
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
519
+ StyleGuide: '#no-nested-ternary'
521
520
  Enabled: true
522
521
 
523
522
  Style/Next:
524
523
  Description: 'Use `next` to skip iteration instead of a condition at the end.'
525
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
524
+ StyleGuide: '#no-nested-conditionals'
526
525
  Enabled: true
527
526
 
528
527
  Style/NilComparison:
529
528
  Description: 'Prefer x.nil? to x == nil.'
530
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
529
+ StyleGuide: '#predicate-methods'
531
530
  Enabled: true
532
531
 
533
532
  Style/NonNilCheck:
534
533
  Description: 'Checks for redundant nil checks.'
535
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
534
+ StyleGuide: '#no-non-nil-checks'
536
535
  Enabled: true
537
536
 
538
537
  Style/Not:
539
538
  Description: 'Use ! instead of not.'
540
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
539
+ StyleGuide: '#bang-not-not'
541
540
  Enabled: true
542
541
 
543
542
  Style/NumericLiterals:
544
543
  Description: >-
545
544
  Add underscores to large numeric literals to improve their
546
545
  readability.
547
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
546
+ StyleGuide: '#underscores-in-numerics'
548
547
  Enabled: true
549
548
 
550
549
  Style/NumericLiteralPrefix:
551
550
  Description: 'Use smallcase prefixes for numeric literals.'
552
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#numeric-literal-prefixes'
551
+ StyleGuide: '#numeric-literal-prefixes'
553
552
  Enabled: true
554
553
 
555
554
  Style/NumericPredicate:
556
555
  Description: >-
557
556
  Checks for the use of predicate- or comparison methods for
558
557
  numeric comparisons.
559
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
558
+ StyleGuide: '#predicate-methods'
559
+ # This will change to a new method call which isn't guaranteed to be on the
560
+ # object. Switching these methods has to be done with knowledge of the types
561
+ # of the variables which rubocop doesn't have.
562
+ AutoCorrect: false
560
563
  Enabled: true
561
564
 
562
565
  Style/OneLineConditional:
563
566
  Description: >-
564
567
  Favor the ternary operator(?:) over
565
568
  if/then/else/end constructs.
566
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
569
+ StyleGuide: '#ternary-operator'
567
570
  Enabled: true
568
571
 
569
572
  Style/OpMethod:
570
573
  Description: 'When defining binary operators, name the argument other.'
571
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
574
+ StyleGuide: '#other-arg'
572
575
  Enabled: true
573
576
 
574
577
  Style/OptionalArguments:
575
578
  Description: >-
576
579
  Checks for optional arguments that do not appear at the end
577
580
  of the argument list
578
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
581
+ StyleGuide: '#optional-arguments'
579
582
  Enabled: true
580
583
 
581
584
  Style/ParallelAssignment:
@@ -583,19 +586,19 @@ Style/ParallelAssignment:
583
586
  Check for simple usages of parallel assignment.
584
587
  It will only warn when the number of variables
585
588
  matches on both sides of the assignment.
586
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
589
+ StyleGuide: '#parallel-assignment'
587
590
  Enabled: true
588
591
 
589
592
  Style/ParenthesesAroundCondition:
590
593
  Description: >-
591
594
  Don't use parentheses around the condition of an
592
595
  if/unless/while.
593
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
596
+ StyleGuide: '#no-parens-if'
594
597
  Enabled: true
595
598
 
596
599
  Style/PercentLiteralDelimiters:
597
600
  Description: 'Use `%`-literal delimiters consistently'
598
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
601
+ StyleGuide: '#percent-literal-braces'
599
602
  Enabled: true
600
603
 
601
604
  Style/PercentQLiterals:
@@ -604,32 +607,37 @@ Style/PercentQLiterals:
604
607
 
605
608
  Style/PerlBackrefs:
606
609
  Description: 'Avoid Perl-style regex back references.'
607
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
610
+ StyleGuide: '#no-perl-regexp-last-matchers'
608
611
  Enabled: true
609
612
 
610
613
  Style/PredicateName:
611
614
  Description: 'Check the names of predicate methods.'
612
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
615
+ StyleGuide: '#bool-methods-qmark'
616
+ Enabled: true
617
+
618
+ Style/PreferredHashMethods:
619
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
620
+ StyleGuide: '#hash-key'
613
621
  Enabled: true
614
622
 
615
623
  Style/Proc:
616
624
  Description: 'Use proc instead of Proc.new.'
617
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
625
+ StyleGuide: '#proc'
618
626
  Enabled: true
619
627
 
620
628
  Style/RaiseArgs:
621
629
  Description: 'Checks the arguments passed to raise/fail.'
622
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
630
+ StyleGuide: '#exception-class-messages'
623
631
  Enabled: true
624
632
 
625
633
  Style/RedundantBegin:
626
634
  Description: "Don't use begin blocks when they are not needed."
627
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
635
+ StyleGuide: '#begin-implicit'
628
636
  Enabled: true
629
637
 
630
638
  Style/RedundantException:
631
639
  Description: "Checks for an obsolete RuntimeException argument in raise/fail."
632
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
640
+ StyleGuide: '#no-explicit-runtimeerror'
633
641
  Enabled: true
634
642
 
635
643
  Style/RedundantFreeze:
@@ -642,17 +650,17 @@ Style/RedundantParentheses:
642
650
 
643
651
  Style/RedundantReturn:
644
652
  Description: "Don't use return where it's not required."
645
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
653
+ StyleGuide: '#no-explicit-return'
646
654
  Enabled: true
647
655
 
648
656
  Style/RedundantSelf:
649
657
  Description: "Don't use self where it's not needed."
650
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
658
+ StyleGuide: '#no-self-unless-required'
651
659
  Enabled: true
652
660
 
653
661
  Style/RegexpLiteral:
654
662
  Description: 'Use / or %r around regular expressions.'
655
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
663
+ StyleGuide: '#percent-r'
656
664
  Enabled: true
657
665
 
658
666
  Style/RescueEnsureAlignment:
@@ -661,7 +669,7 @@ Style/RescueEnsureAlignment:
661
669
 
662
670
  Style/RescueModifier:
663
671
  Description: 'Avoid using rescue in its modifier form.'
664
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
672
+ StyleGuide: '#no-rescue-modifiers'
665
673
  Enabled: true
666
674
 
667
675
  Style/SafeNavigation:
@@ -675,27 +683,27 @@ Style/SelfAssignment:
675
683
  Description: >-
676
684
  Checks for places where self-assignment shorthand should have
677
685
  been used.
678
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
686
+ StyleGuide: '#self-assignment'
679
687
  Enabled: true
680
688
 
681
689
  Style/Semicolon:
682
690
  Description: "Don't use semicolons to terminate expressions."
683
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
691
+ StyleGuide: '#no-semicolon'
684
692
  Enabled: true
685
693
 
686
694
  Style/SignalException:
687
695
  Description: 'Checks for proper usage of fail and raise.'
688
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail'
696
+ StyleGuide: '#prefer-raise-over-fail'
689
697
  Enabled: true
690
698
 
691
699
  Style/SingleLineBlockParams:
692
700
  Description: 'Enforces the names of some block params.'
693
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
701
+ StyleGuide: '#reduce-blocks'
694
702
  Enabled: true
695
703
 
696
704
  Style/SingleLineMethods:
697
705
  Description: 'Avoid single-line methods.'
698
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
706
+ StyleGuide: '#no-single-line-methods'
699
707
  Enabled: true
700
708
 
701
709
  Style/SpaceBeforeFirstArg:
@@ -706,29 +714,29 @@ Style/SpaceBeforeFirstArg:
706
714
 
707
715
  Style/SpaceAfterColon:
708
716
  Description: 'Use spaces after colons.'
709
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
717
+ StyleGuide: '#spaces-operators'
710
718
  Enabled: true
711
719
 
712
720
  Style/SpaceAfterComma:
713
721
  Description: 'Use spaces after commas.'
714
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
722
+ StyleGuide: '#spaces-operators'
715
723
  Enabled: true
716
724
 
717
725
  Style/SpaceAfterMethodName:
718
726
  Description: >-
719
727
  Do not put a space between a method name and the opening
720
728
  parenthesis in a method definition.
721
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
729
+ StyleGuide: '#parens-no-spaces'
722
730
  Enabled: true
723
731
 
724
732
  Style/SpaceAfterNot:
725
733
  Description: Tracks redundant space after the ! operator.
726
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
734
+ StyleGuide: '#no-space-bang'
727
735
  Enabled: true
728
736
 
729
737
  Style/SpaceAfterSemicolon:
730
738
  Description: 'Use spaces after semicolons.'
731
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
739
+ StyleGuide: '#spaces-operators'
732
740
  Enabled: true
733
741
 
734
742
  Style/SpaceBeforeBlockBraces:
@@ -767,7 +775,7 @@ Style/SpaceAroundEqualsInParameterDefault:
767
775
  Checks that the equals signs in parameter default assignments
768
776
  have or don't have surrounding space depending on
769
777
  configuration.
770
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
778
+ StyleGuide: '#spaces-around-equals'
771
779
  Enabled: true
772
780
 
773
781
  Style/SpaceAroundKeyword:
@@ -776,7 +784,7 @@ Style/SpaceAroundKeyword:
776
784
 
777
785
  Style/SpaceAroundOperators:
778
786
  Description: 'Use a single space around operators.'
779
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
787
+ StyleGuide: '#spaces-operators'
780
788
  Enabled: true
781
789
 
782
790
  Style/SpaceInsideArrayPercentLiteral:
@@ -789,42 +797,42 @@ Style/SpaceInsidePercentLiteralDelimiters:
789
797
 
790
798
  Style/SpaceInsideBrackets:
791
799
  Description: 'No spaces after [ or before ].'
792
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
800
+ StyleGuide: '#no-spaces-braces'
793
801
  Enabled: true
794
802
 
795
803
  Style/SpaceInsideHashLiteralBraces:
796
804
  Description: "Use spaces inside hash literal braces - or don't."
797
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
805
+ StyleGuide: '#spaces-operators'
798
806
  Enabled: true
799
807
 
800
808
  Style/SpaceInsideParens:
801
809
  Description: 'No spaces after ( or before ).'
802
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
810
+ StyleGuide: '#no-spaces-braces'
803
811
  Enabled: true
804
812
 
805
813
  Style/SpaceInsideRangeLiteral:
806
814
  Description: 'No spaces inside range literals.'
807
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
815
+ StyleGuide: '#no-space-inside-range-literals'
808
816
  Enabled: true
809
817
 
810
818
  Style/SpaceInsideStringInterpolation:
811
819
  Description: 'Checks for padding/surrounding spaces inside string interpolation.'
812
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
820
+ StyleGuide: '#string-interpolation'
813
821
  Enabled: true
814
822
 
815
823
  Style/SpecialGlobalVars:
816
824
  Description: 'Avoid Perl-style global variables.'
817
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
825
+ StyleGuide: '#no-cryptic-perlisms'
818
826
  Enabled: true
819
827
 
820
828
  Style/StabbyLambdaParentheses:
821
829
  Description: 'Check for the usage of parentheses around stabby lambda arguments.'
822
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args'
830
+ StyleGuide: '#stabby-lambda-with-args'
823
831
  Enabled: true
824
832
 
825
833
  Style/StringLiterals:
826
834
  Description: 'Checks if uses of quotes match the configured preference.'
827
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
835
+ StyleGuide: '#consistent-string-literals'
828
836
  Enabled: true
829
837
 
830
838
  Style/StringLiteralsInInterpolation:
@@ -835,7 +843,7 @@ Style/StringLiteralsInInterpolation:
835
843
 
836
844
  Style/StructInheritance:
837
845
  Description: 'Checks for inheritance from Struct.new.'
838
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
846
+ StyleGuide: '#no-extend-struct-new'
839
847
  Enabled: true
840
848
 
841
849
  Style/SymbolLiteral:
@@ -848,7 +856,7 @@ Style/SymbolProc:
848
856
 
849
857
  Style/Tab:
850
858
  Description: 'No hard tabs.'
851
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
859
+ StyleGuide: '#spaces-indentation'
852
860
  Enabled: true
853
861
 
854
862
  Style/TernaryParentheses:
@@ -857,34 +865,34 @@ Style/TernaryParentheses:
857
865
 
858
866
  Style/TrailingBlankLines:
859
867
  Description: 'Checks trailing blank lines and final newline.'
860
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
868
+ StyleGuide: '#newline-eof'
861
869
  Enabled: true
862
870
 
863
871
  Style/TrailingCommaInArguments:
864
872
  Description: 'Checks for trailing comma in argument lists.'
865
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
873
+ StyleGuide: '#no-trailing-params-comma'
866
874
  Enabled: true
867
875
 
868
876
  Style/TrailingCommaInLiteral:
869
877
  Description: 'Checks for trailing comma in array and hash literals.'
870
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
878
+ StyleGuide: '#no-trailing-array-commas'
871
879
  Enabled: true
872
880
 
873
881
  Style/TrailingWhitespace:
874
882
  Description: 'Avoid trailing whitespace.'
875
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
883
+ StyleGuide: '#no-trailing-whitespace'
876
884
  Enabled: true
877
885
 
878
886
  Style/TrivialAccessors:
879
887
  Description: 'Prefer attr_* methods to trivial readers/writers.'
880
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
888
+ StyleGuide: '#attr_family'
881
889
  Enabled: true
882
890
 
883
891
  Style/UnlessElse:
884
892
  Description: >-
885
893
  Do not use unless with else. Rewrite these with the positive
886
894
  case first.
887
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
895
+ StyleGuide: '#no-else-with-unless'
888
896
  Enabled: true
889
897
 
890
898
  Style/UnneededCapitalW:
@@ -897,7 +905,7 @@ Style/UnneededInterpolation:
897
905
 
898
906
  Style/UnneededPercentQ:
899
907
  Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
900
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
908
+ StyleGuide: '#percent-q'
901
909
  Enabled: true
902
910
 
903
911
  Style/TrailingUnderscoreVariable:
@@ -911,12 +919,12 @@ Style/VariableInterpolation:
911
919
  Description: >-
912
920
  Don't interpolate global, instance and class variables
913
921
  directly in strings.
914
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
922
+ StyleGuide: '#curlies-interpolate'
915
923
  Enabled: true
916
924
 
917
925
  Style/VariableName:
918
926
  Description: 'Use the configured style when naming variables.'
919
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
927
+ StyleGuide: '#snake-case-symbols-methods-vars'
920
928
  Enabled: true
921
929
 
922
930
  Style/VariableNumber:
@@ -925,24 +933,24 @@ Style/VariableNumber:
925
933
 
926
934
  Style/WhenThen:
927
935
  Description: 'Use when x then ... for one-line cases.'
928
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
936
+ StyleGuide: '#one-line-cases'
929
937
  Enabled: true
930
938
 
931
939
  Style/WhileUntilDo:
932
940
  Description: 'Checks for redundant do after while or until.'
933
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
941
+ StyleGuide: '#no-multiline-while-do'
934
942
  Enabled: true
935
943
 
936
944
  Style/WhileUntilModifier:
937
945
  Description: >-
938
946
  Favor modifier while/until usage when you have a
939
947
  single-line body.
940
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
948
+ StyleGuide: '#while-as-a-modifier'
941
949
  Enabled: true
942
950
 
943
951
  Style/WordArray:
944
952
  Description: 'Use %w or %W for arrays of words.'
945
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
953
+ StyleGuide: '#percent-w'
946
954
  Enabled: true
947
955
 
948
956
  Style/ZeroLengthPredicate:
@@ -960,7 +968,7 @@ Metrics/AbcSize:
960
968
 
961
969
  Metrics/BlockNesting:
962
970
  Description: 'Avoid excessive block nesting'
963
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
971
+ StyleGuide: '#three-is-the-number-thou-shalt-count'
964
972
  Enabled: true
965
973
 
966
974
  Metrics/ClassLength:
@@ -979,17 +987,21 @@ Metrics/CyclomaticComplexity:
979
987
 
980
988
  Metrics/LineLength:
981
989
  Description: 'Limit lines to 80 characters.'
982
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
990
+ StyleGuide: '#80-character-limits'
983
991
  Enabled: true
984
992
 
985
993
  Metrics/MethodLength:
986
994
  Description: 'Avoid methods longer than 10 lines of code.'
987
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
995
+ StyleGuide: '#short-methods'
996
+ Enabled: true
997
+
998
+ Metrics/BlockLength:
999
+ Description: 'Avoid long blocks with many lines.'
988
1000
  Enabled: true
989
1001
 
990
1002
  Metrics/ParameterLists:
991
1003
  Description: 'Avoid parameter lists longer than three or four parameters.'
992
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
1004
+ StyleGuide: '#too-many-params'
993
1005
  Enabled: true
994
1006
 
995
1007
  Metrics/PerceivedComplexity:
@@ -1005,7 +1017,7 @@ Lint/AmbiguousOperator:
1005
1017
  Description: >-
1006
1018
  Checks for ambiguous operators in the first argument of a
1007
1019
  method invocation without parentheses.
1008
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-invocation-parens'
1020
+ StyleGuide: '#method-invocation-parens'
1009
1021
  Enabled: true
1010
1022
 
1011
1023
  Lint/AmbiguousRegexpLiteral:
@@ -1016,7 +1028,7 @@ Lint/AmbiguousRegexpLiteral:
1016
1028
 
1017
1029
  Lint/AssignmentInCondition:
1018
1030
  Description: "Don't use assignment in conditions."
1019
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
1031
+ StyleGuide: '#safe-assignment-in-condition'
1020
1032
  Enabled: true
1021
1033
 
1022
1034
  Lint/BlockAlignment:
@@ -1031,7 +1043,7 @@ Lint/ConditionPosition:
1031
1043
  Description: >-
1032
1044
  Checks for condition placed in a confusing position relative to
1033
1045
  the keyword.
1034
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
1046
+ StyleGuide: '#same-line-condition'
1035
1047
  Enabled: true
1036
1048
 
1037
1049
  Lint/Debugger:
@@ -1080,7 +1092,7 @@ Lint/EndInMethod:
1080
1092
 
1081
1093
  Lint/EnsureReturn:
1082
1094
  Description: 'Do not use return in an ensure block.'
1083
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
1095
+ StyleGuide: '#no-return-ensure'
1084
1096
  Enabled: true
1085
1097
 
1086
1098
  Lint/Eval:
@@ -1099,7 +1111,7 @@ Lint/FormatParameterMismatch:
1099
1111
 
1100
1112
  Lint/HandleExceptions:
1101
1113
  Description: "Don't suppress exception."
1102
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
1114
+ StyleGuide: '#dont-hide-exceptions'
1103
1115
  Enabled: true
1104
1116
 
1105
1117
  Lint/ImplicitStringConcatenation:
@@ -1136,12 +1148,12 @@ Lint/Loop:
1136
1148
  Description: >-
1137
1149
  Use Kernel#loop with break rather than begin/end/until or
1138
1150
  begin/end/while for post-loop tests.
1139
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
1151
+ StyleGuide: '#loop-with-break'
1140
1152
  Enabled: true
1141
1153
 
1142
1154
  Lint/NestedMethodDefinition:
1143
1155
  Description: 'Do not use nested method definitions.'
1144
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
1156
+ StyleGuide: '#no-nested-methods'
1145
1157
  Enabled: true
1146
1158
 
1147
1159
  Lint/NextWithoutAccumulator:
@@ -1158,7 +1170,7 @@ Lint/ParenthesesAsGroupedExpression:
1158
1170
  Description: >-
1159
1171
  Checks for method calls with a space before the opening
1160
1172
  parenthesis.
1161
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
1173
+ StyleGuide: '#parens-no-spaces'
1162
1174
  Enabled: true
1163
1175
 
1164
1176
  Lint/PercentStringArray:
@@ -1185,7 +1197,7 @@ Lint/RequireParentheses:
1185
1197
 
1186
1198
  Lint/RescueException:
1187
1199
  Description: 'Avoid rescuing the Exception class.'
1188
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
1200
+ StyleGuide: '#no-blind-rescues'
1189
1201
  Enabled: true
1190
1202
 
1191
1203
  Lint/ShadowedException:
@@ -1202,7 +1214,7 @@ Lint/ShadowingOuterLocalVariable:
1202
1214
 
1203
1215
  Lint/StringConversionInInterpolation:
1204
1216
  Description: 'Checks for Object#to_s usage in string interpolation.'
1205
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
1217
+ StyleGuide: '#no-to-s'
1206
1218
  Enabled: true
1207
1219
 
1208
1220
  Lint/UnderscorePrefixedVariableName:
@@ -1226,12 +1238,12 @@ Lint/UnneededSplatExpansion:
1226
1238
 
1227
1239
  Lint/UnusedBlockArgument:
1228
1240
  Description: 'Checks for unused block arguments.'
1229
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1241
+ StyleGuide: '#underscore-unused-vars'
1230
1242
  Enabled: true
1231
1243
 
1232
1244
  Lint/UnusedMethodArgument:
1233
1245
  Description: 'Checks for unused method arguments.'
1234
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1246
+ StyleGuide: '#underscore-unused-vars'
1235
1247
  Enabled: true
1236
1248
 
1237
1249
  Lint/UnreachableCode:
@@ -1245,7 +1257,7 @@ Lint/UselessAccessModifier:
1245
1257
 
1246
1258
  Lint/UselessAssignment:
1247
1259
  Description: 'Checks for useless assignment to a local variable.'
1248
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1260
+ StyleGuide: '#underscore-unused-vars'
1249
1261
  Enabled: true
1250
1262
 
1251
1263
  Lint/UselessComparison:
@@ -1311,6 +1323,10 @@ Performance/DoubleStartEndWith:
1311
1323
  Performance/EndWith:
1312
1324
  Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
1313
1325
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1326
+ # This will change to a new method call which isn't guaranteed to be on the
1327
+ # object. Switching these methods has to be done with knowledge of the types
1328
+ # of the variables which rubocop doesn't have.
1329
+ AutoCorrect: false
1314
1330
  Enabled: true
1315
1331
 
1316
1332
  Performance/FixedSize:
@@ -1334,7 +1350,7 @@ Performance/HashEachMethods:
1334
1350
  Description: >-
1335
1351
  Use `Hash#each_key` and `Hash#each_value` instead of
1336
1352
  `Hash#keys.each` and `Hash#values.each`.
1337
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-each'
1353
+ StyleGuide: '#hash-each'
1338
1354
  Enabled: true
1339
1355
  AutoCorrect: false
1340
1356
 
@@ -1393,6 +1409,10 @@ Performance/SortWithBlock:
1393
1409
  Performance/StartWith:
1394
1410
  Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
1395
1411
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1412
+ # This will change to a new method call which isn't guaranteed to be on the
1413
+ # object. Switching these methods has to be done with knowledge of the types
1414
+ # of the variables which rubocop doesn't have.
1415
+ AutoCorrect: false
1396
1416
  Enabled: true
1397
1417
 
1398
1418
  Performance/StringReplacement:
@@ -1423,6 +1443,15 @@ Rails/Delegate:
1423
1443
  Description: 'Prefer delegate method for delegations.'
1424
1444
  Enabled: true
1425
1445
 
1446
+ Rails/DelegateAllowBlank:
1447
+ Description: 'Do not use allow_blank as an option to delegate.'
1448
+ Enabled: true
1449
+
1450
+ Rails/DynamicFindBy:
1451
+ Description: 'Use `find_by` instead of dynamic `find_by_*`.'
1452
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1453
+ Enabled: true
1454
+
1426
1455
  Rails/Exit:
1427
1456
  Description: >-
1428
1457
  Favor `fail`, `break`, `return`, etc. over `exit` in
@@ -1445,6 +1474,13 @@ Rails/HasAndBelongsToMany:
1445
1474
  StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
1446
1475
  Enabled: true
1447
1476
 
1477
+ Rails/HttpPositionalArguments:
1478
+ Description: 'Use keyword arguments instead of positional arguments in http method calls.'
1479
+ Enabled: true
1480
+ Include:
1481
+ - 'spec/**/*'
1482
+ - 'test/**/*'
1483
+
1448
1484
  Rails/NotNullColumn:
1449
1485
  Description: 'Do not add a NOT NULL column without a default value'
1450
1486
  Enabled: true
@@ -1495,5 +1531,11 @@ Rails/Validation:
1495
1531
  Enabled: true
1496
1532
 
1497
1533
  Security/JSONLoad:
1498
- Description : 'Prefer usage of JSON.parse'
1534
+ Description: >-
1535
+ Prefer usage of `JSON.parse` over `JSON.load` due to potential
1536
+ security issues. See reference for more information.
1537
+ Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
1499
1538
  Enabled: true
1539
+ # Autocorrect here will change to a method that may cause crashes depending
1540
+ # on the value of the argument.
1541
+ AutoCorrect: false