Skip to content

Commit

Permalink
Use line_with_comment? instead of bad API
Browse files Browse the repository at this point in the history
`RuboCop::Cop::Util#comment_line?` is flagged by rubocop/rubocop#8405 as a bad API.
So I propose to fix not use this method.
  • Loading branch information
ydah committed Feb 7, 2023
1 parent 7bed149 commit 2220194
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rubocop/cop/rspec/mixin/empty_line_separation.rb
Expand Up @@ -25,8 +25,7 @@ def missing_separating_line_offense(node)

def missing_separating_line(node)
line = final_end_line = final_end_location(node).line

while comment_line?(processed_source[line])
while processed_source.line_with_comment?(line + 1)
line += 1
comment = processed_source.comment_at_line(line)
if DirectiveComment.new(comment).enabled?
Expand Down

0 comments on commit 2220194

Please sign in to comment.