Class: MessageFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/xcode_warnings/message_formatter.rb

Overview

Formatter for parsed warnings.

Instance Method Summary collapse

Instance Method Details

#format(item) ⇒ String

Format an item to text for Danger.

Parameters:

  • An (Warning)

    item to format.

Returns:

  • (String)

    Formatted text.



10
11
12
13
14
15
16
17
18
19
# File 'lib/xcode_warnings/message_formatter.rb', line 10

def format(item)
  file = item[:file]
  line = item[:line]
  message = item[:message]
  if file.nil? || line.nil?
    message
  else
    "**#{file}#L#{line}** #{message}"
  end
end