Class: PreCommit::Message::Formatter
- Inherits:
-
Object
- Object
- PreCommit::Message::Formatter
- Defined in:
- lib/plugins/pre_commit/message/formatter.rb
Overview
Responsible for format a given output
Instance Method Summary collapse
-
#format(errors) ⇒ String
Format output for a given
errorsdetails.
Instance Method Details
#format(errors) ⇒ String
Format output for a given errors details
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/plugins/pre_commit/message/formatter.rb', line 13 def format(errors) throw ArgumentError.new if errors.nil? || errors.empty? files = errors['checkstyle']['file'] return nil if files.empty? return format_single(files) unless files.is_a? Array format_multiple(files) end |