1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-20 08:58:55 +02:00

Correct description and severity on Flake8 linter

Test Plan: do it live

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4274
This commit is contained in:
David Cramer 2012-12-21 16:13:16 -08:00 committed by epriestley
parent 4ca70d4e48
commit 0b833c2f02

View file

@ -91,12 +91,10 @@ final class ArcanistFlake8Linter extends ArcanistLinter {
$matches[$key] = trim($match);
}
$severity = ArcanistLintSeverity::SEVERITY_WARNING;
$description = $matches[3];
$error_regexp = '/(^undefined|^duplicate|before assignment$)/';
if (preg_match($error_regexp, $description)) {
if (substr($matches[4], 0, 1) == 'E') {
$severity = ArcanistLintSeverity::SEVERITY_ERROR;
} else {
$severity = ArcanistLintSeverity::SEVERITY_WARNING;
}
$message = new ArcanistLintMessage();
@ -105,8 +103,8 @@ final class ArcanistFlake8Linter extends ArcanistLinter {
if (!empty($matches[3]))
$message->setChar($matches[3]);
$message->setCode($matches[4]);
$message->setName($this->getLinterName().' '.$matches[4]);
$message->setDescription($description);
$message->setName($this->getLinterName().' '.$matches[3]);
$message->setDescription($matches[5]);
$message->setSeverity($severity);
$this->addLintMessage($message);
}