mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 23:02:41 +01:00
Fix CPP Lint severity
Summary: Currently all CPPLint issues are hard-coded to warning level, which prevents customising the severity in .arclint. Change to pick up the configured severity. Note that getLintMessageSeverity will call getDefaultMessageSeverity if nothing is configured for that error category. Test Plan: Tested manually to confirm configured categories display with the correct severity and that non-configured ones return with the default severity (ERROR). Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9682
This commit is contained in:
parent
60a5a24033
commit
ddfdfce3f5
1 changed files with 8 additions and 1 deletions
|
@ -35,6 +35,10 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter {
|
||||||
return $this->getDeprecatedConfiguration('lint.cpplint.options', array());
|
return $this->getDeprecatedConfiguration('lint.cpplint.options', array());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getDefaultMessageSeverity($code) {
|
||||||
|
return ArcanistLintSeverity::SEVERITY_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
|
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
|
||||||
$lines = explode("\n", $stderr);
|
$lines = explode("\n", $stderr);
|
||||||
|
|
||||||
|
@ -49,13 +53,16 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter {
|
||||||
foreach ($matches as $key => $match) {
|
foreach ($matches as $key => $match) {
|
||||||
$matches[$key] = trim($match);
|
$matches[$key] = trim($match);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$severity = $this->getLintMessageSeverity($matches[3]);
|
||||||
|
|
||||||
$message = new ArcanistLintMessage();
|
$message = new ArcanistLintMessage();
|
||||||
$message->setPath($path);
|
$message->setPath($path);
|
||||||
$message->setLine($matches[1]);
|
$message->setLine($matches[1]);
|
||||||
$message->setCode($matches[3]);
|
$message->setCode($matches[3]);
|
||||||
$message->setName($matches[3]);
|
$message->setName($matches[3]);
|
||||||
$message->setDescription($matches[2]);
|
$message->setDescription($matches[2]);
|
||||||
$message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING);
|
$message->setSeverity($severity);
|
||||||
|
|
||||||
$messages[] = $message;
|
$messages[] = $message;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue