Method: RuboCop::Cop::MessageAnnotator#initialize

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

#initialize(config, cop_name, cop_config, options) ⇒ MessageAnnotator

Returns a new instance of MessageAnnotator.

Parameters:

  • config (RuboCop::Config)

    Check configs for all cops @note Message Annotator specifically checks the

    following config options for_all_cops
    :StyleGuideBaseURL [String] URL for styleguide
    :DisplayStyleGuide [Boolean] Include styleguide and reference URLs
    :ExtraDetails [Boolean] Include cop details
    :DisplayCopNames [Boolean] Include cop name
    
  • cop_name (String)

    for specific cop name

  • cop_config (Hash)

    configs for specific cop, from config#for_cop

  • options (Hash, nil)

    optional

Options Hash (cop_config):

  • :StyleGuide (String)

    Extension of base styleguide URL

  • :References (String)

    Full reference URLs

  • :Details (String)

Options Hash (options):

  • :display_style_guide (Boolean)

    Include style guide and reference URLs

  • :extra_details (Boolean)

    Include cop specific details

  • :debug (Boolean)

    Include debug output

  • :display_cop_names (Boolean)

    Include cop name



47
48
49
50
51
52
# File 'lib/rubocop/cop/message_annotator.rb', line 47

def initialize(config, cop_name, cop_config, options)
  @config = config
  @cop_name = cop_name
  @cop_config = cop_config || {}
  @options = options
end