Class: PreCommit::Message::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/pre_commit/message/formatter.rb

Overview

Responsible for format a given output

Instance Method Summary collapse

Instance Method Details

#format(checkstyle) ⇒ String

Format output for a given errors details

Parameters:

Returns:

  • (String)

    formatted output or nil when has no errors

Raises:

  • ArgumentError when input is empty



15
16
17
18
19
20
# File 'lib/plugins/pre_commit/message/formatter.rb', line 15

def format(checkstyle)
  throw ArgumentError.new if checkstyle.nil?
  return nil if checkstyle.good?

  format_multiple(checkstyle.bad_files)
end