Skip to content

Commit e0f28e0

Browse files
marcandrebbatsov
authored andcommitted
Deprecate comment_lines?
1 parent 9a08fde commit e0f28e0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/rubocop/cop/util.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ module Util
1414

1515
module_function
1616

17+
# This is a bad API
1718
def comment_line?(line_source)
1819
/^\s*#/.match?(line_source)
1920
end
2021

22+
# @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment` or similar
2123
def comment_lines?(node)
2224
processed_source[line_range(node)].any? { |line| comment_line?(line) }
2325
end

0 commit comments

Comments
 (0)