Class: Rubocop::Cop::BlockComments

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/block_comments.rb

Constant Summary collapse

MSG =
'Do not use block comments.'

Instance Attribute Summary

Attributes inherited from Cop

#debug, #disabled_lines, #offences

Instance Method Summary collapse

Methods inherited from Cop

#add_offence, cop_name, #has_report?, #ignore_node, inherited, #initialize, #inspect, #name

Constructor Details

This class inherits a constructor from Rubocop::Cop::Cop

Instance Method Details

#on_comment(comment) ⇒ Object



8
9
10
11
12
# File 'lib/rubocop/cop/block_comments.rb', line 8

def on_comment(comment)
  if comment.text.start_with?('=begin')
    add_offence(:convention, comment.loc.line, MSG)
  end
end