mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 08:42:40 +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) {
|
foreach ($matches as $key => $match) {
|
||||||
$matches[$key] = trim($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 = new ArcanistLintMessage();
|
||||||
$message->setPath($path);
|
$message->setPath($path);
|
||||||
$message->setLine($matches[2]);
|
$message->setLine($matches[2]);
|
||||||
$message->setCode($this->getLinterName());
|
$message->setCode($this->getLinterName());
|
||||||
$message->setDescription($matches[3]);
|
$message->setDescription($description);
|
||||||
$message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING);
|
$message->setSeverity($severity);
|
||||||
$this->addLintMessage($message);
|
$this->addLintMessage($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue