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:
commit
1e5656875f
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