lib/cc/analyzer/formatters/formatter.rb in codeclimate-0.36.0 vs lib/cc/analyzer/formatters/formatter.rb in codeclimate-0.37.0

- old
+ new

@@ -5,10 +5,21 @@ def initialize(filesystem, output = $stdout) @filesystem = filesystem @output = output end - def write(_data) + def write(data) + json = JSON.parse(data) + json["engine_name"] = current_engine.name + + case json["type"].downcase + when "issue" + issues << json + when "warning" + warnings << json + else + raise "Invalid type found: #{json["type"]}" + end end def started end