4
* Shows lint messages to the user.
6
final class ArcanistCheckstyleXMLLintRenderer extends ArcanistLintRenderer {
10
public function __construct() {
11
$this->writer = new XMLWriter();
12
$this->writer->openMemory();
13
$this->writer->setIndent(true);
14
$this->writer->setIndentString(' ');
17
public function renderPreamble() {
18
$this->writer->startDocument('1.0', 'UTF-8');
19
$this->writer->startElement('checkstyle');
20
$this->writer->writeAttribute('version', '4.3');
21
return $this->writer->flush();
24
public function renderLintResult(ArcanistLintResult $result) {
25
$this->writer->startElement('file');
26
$this->writer->writeAttribute('name', $result->getPath());
28
foreach ($result->getMessages() as $message) {
29
$this->writer->startElement('error');
31
$this->writer->writeAttribute('line', $message->getLine());
32
$this->writer->writeAttribute('column', $message->getChar());
33
$this->writer->writeAttribute('severity',
34
ArcanistLintSeverity::getStringForSeverity($message->getSeverity()));
35
$this->writer->writeAttribute('message', $message->getDescription());
36
$this->writer->writeAttribute('source', $message->getCode());
38
$this->writer->endElement();
41
$this->writer->endElement();
42
return $this->writer->flush();
45
public function renderOkayResult() {
49
public function renderPostamble() {
50
$this->writer->endElement();
51
$this->writer->endDocument();
52
return $this->writer->flush();