From e0f28e084011b1471de67676c180ba2071757a31 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sun, 26 Jul 2020 16:57:00 -0400 Subject: [PATCH] Deprecate comment_lines? --- lib/rubocop/cop/util.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rubocop/cop/util.rb b/lib/rubocop/cop/util.rb index 6b1b6ffb9bc..d6f1cc62ea4 100644 --- a/lib/rubocop/cop/util.rb +++ b/lib/rubocop/cop/util.rb @@ -14,10 +14,12 @@ module Util module_function + # This is a bad API def comment_line?(line_source) /^\s*#/.match?(line_source) end + # @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment` or similar def comment_lines?(node) processed_source[line_range(node)].any? { |line| comment_line?(line) } end