Class: Reek::Report::WikiLinkWarningFormatter Private

Inherits:
SimpleWarningFormatter show all
Defined in:
lib/reek/report/formatter.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Formatter that adds a link to the wiki to the basic message from SimpleWarningFormatter.

Constant Summary collapse

'https://github.com/troessner/reek/wiki/'

Instance Method Summary collapse

Methods inherited from SimpleWarningFormatter

#initialize

Constructor Details

This class inherits a constructor from Reek::Report::SimpleWarningFormatter

Instance Method Details

#class_name_to_param(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



65
66
67
# File 'lib/reek/report/formatter.rb', line 65

def class_name_to_param(name)
  name.split(/(?=[A-Z])/).join('-')
end

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



61
62
63
# File 'lib/reek/report/formatter.rb', line 61

def explanatory_link(warning)
  "#{BASE_URL_FOR_HELP_LINK}#{class_name_to_param(warning.smell_type)}"
end

#format(warning) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
59
# File 'lib/reek/report/formatter.rb', line 56

def format(warning)
  "#{super} " \
    "[#{explanatory_link(warning)}]"
end