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:
parent
cd2f8edb83
commit
6e2016b47b
1 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue