1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Fix checkstyle severities

Summary: "Advice" is not a valid severity for Checkstyle... valid severities are `ignore`, `info`, `warning` and `error`.

Test Plan: Read the [[http://checkstyle.sourceforge.net/property_types.html | documentation]].

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13684
This commit is contained in:
Joshua Spence 2015-07-23 09:09:33 +10:00
parent e286ef66c8
commit 5e4f9a2bf9

View file

@ -31,7 +31,7 @@ final class ArcanistCheckstyleXMLLintRenderer extends ArcanistLintRenderer {
$this->writer->writeAttribute('line', $message->getLine());
$this->writer->writeAttribute('column', $message->getChar());
$this->writer->writeAttribute('severity',
ArcanistLintSeverity::getStringForSeverity($message->getSeverity()));
$this->getStringForSeverity($message->getSeverity()));
$this->writer->writeAttribute('message', $message->getDescription());
$this->writer->writeAttribute('source', $message->getCode());
@ -52,4 +52,19 @@ final class ArcanistCheckstyleXMLLintRenderer extends ArcanistLintRenderer {
return $this->writer->flush();
}
private function getStringForSeverity($severity) {
switch ($severity) {
case ArcanistLintSeverity::SEVERITY_ADVICE:
return 'info';
case ArcanistLintSeverity::SEVERITY_AUTOFIX:
return 'info';
case ArcanistLintSeverity::SEVERITY_WARNING:
return 'warning';
case ArcanistLintSeverity::SEVERITY_ERROR:
return 'error';
case ArcanistLintSeverity::SEVERITY_DISABLED:
return 'ignore';
}
}
}