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

Merge pull request #43 from rafikk/master

Specify error severity for some PyFlakes messages
This commit is contained in:
Evan Priestley 2012-07-19 10:50:09 -07:00
commit 1e5656875f

View file

@ -100,12 +100,19 @@ final class ArcanistPyFlakesLinter extends ArcanistLinter {
foreach ($matches as $key => $match) {
$matches[$key] = trim($match);
}
$severity = ArcanistLintSeverity::SEVERITY_WARNING;
$description = $matches[3];
if (preg_match('/(^undefined|^duplicate|before assignment$)/', $description)) {
$severity = ArcanistLintSeverity::SEVERITY_ERROR;
}
$message = new ArcanistLintMessage();
$message->setPath($path);
$message->setLine($matches[2]);
$message->setCode($this->getLinterName());
$message->setDescription($matches[3]);
$message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING);
$message->setDescription($description);
$message->setSeverity($severity);
$this->addLintMessage($message);
}
}