Class: SlimLint::Reporter::CheckstyleReporter

Inherits:
SlimLint::Reporter show all
Defined in:
lib/slim_lint/reporter/checkstyle_reporter.rb

Overview

Outputs report as a Checkstyle XML document.

Instance Method Summary collapse

Methods inherited from SlimLint::Reporter

descendants, inherited, #initialize

Constructor Details

This class inherits a constructor from SlimLint::Reporter

Instance Method Details

#display_report(report) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/slim_lint/reporter/checkstyle_reporter.rb', line 8

def display_report(report)
  document = REXML::Document.new.tap do |d|
    d << REXML::XMLDecl.new
  end
  checkstyle = REXML::Element.new('checkstyle', document)

  report.lints.group_by(&:filename).map do |lint|
    map_file(lint, checkstyle)
  end

  log.log document.to_s
end