Class: Rubocop::Cop::Encoding
Constant Summary collapse
- ERROR_MESSAGE =
'Missing encoding comment.'
- MAX_LINE_LENGTH =
80
Instance Attribute Summary
Attributes inherited from Cop
Instance Method Summary collapse
Methods inherited from Cop
#add_offence, enabled?, #has_report?, inherited, #initialize, #inspect_source
Constructor Details
This class inherits a constructor from Rubocop::Cop::Cop
Instance Method Details
#inspect(file, source, tokens, sexp) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/rubocop/cop/encoding.rb', line 9 def inspect(file, source, tokens, sexp) unless source[0] =~ /#.*coding: (UTF|utf)-8/ = sprintf(ERROR_MESSAGE) add_offence(:convention, 0, 0, ) end end |