Skip to content

Commit

Permalink
Deprecate comment_lines?
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre authored and bbatsov committed Aug 10, 2020
1 parent 9a08fde commit e0f28e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rubocop/cop/util.rb
Expand Up @@ -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
Expand Down

0 comments on commit e0f28e0

Please sign in to comment.