1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 08:52:39 +01:00

Specify error message for some pyflakes messages

This commit is contained in:
Rafik Salama 2012-07-19 10:40:31 -07:00
parent cd2f8edb83
commit 6e2016b47b

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);
}
}