class RuboCop::Cop::Style::InlineComment
end
f.bar # Trailing inline comment
foo.each do |f|
# bad
end
f.bar
# Standalone comment
foo.each do |f|
# good
@example
This cop checks for trailing inline comments.
def investigate(processed_source)
def investigate(processed_source) processed_source.comments.each do |comment| next if comment_line?(processed_source[comment.loc.line - 1]) add_offense(comment) end end