Class: Terracop::Formatters::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/terracop/formatters/default.rb

Overview

Default CLI-friendly output formatter.

Instance Method Summary collapse

Instance Method Details

#generate(resources) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/terracop/formatters/default.rb', line 9

def generate(resources)
  out = []
  resources.each do |resource, offenses|
    out << "#{resource.cyan}:"

    offenses.each do |offense|
      out << "#{offense[:cop_name].yellow}: #{offense[:message]}"
    end

    out << ''
  end

  out.join("\n")
end