Method: RuboCop::Cop::MessageAnnotator#annotate

Defined in:
lib/rubocop/cop/message_annotator.rb

#annotate(message) ⇒ String

Returns the annotated message, based on params passed into initializer

Returns:

  • (String)

    annotated message



58
59
60
61
62
63
64
65
66
# File 'lib/rubocop/cop/message_annotator.rb', line 58

def annotate(message)
  message = "#{cop_name}: #{message}" if display_cop_names?
  message += " #{details}" if extra_details? && details
  if display_style_guide?
    links = urls.join(', ')
    message = "#{message} (#{links})"
  end
  message
end