1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 18:22:41 +01:00

Change severity of PEP8 errors to warnings

Summary: None of these are that serious that I would like to be informed about them on unmodified lines.

Test Plan: Linted Python file with lots of PEP8 errors, now warnings.

Reviewers: zeeg, epriestley

Reviewed By: zeeg

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3884
This commit is contained in:
vrana 2012-11-03 21:52:30 -07:00
parent 66d204be81
commit 21530fa459

View file

@ -99,6 +99,9 @@ final class ArcanistPEP8Linter extends ArcanistLinter {
foreach ($matches as $key => $match) { foreach ($matches as $key => $match) {
$matches[$key] = trim($match); $matches[$key] = trim($match);
} }
if (!$this->isMessageEnabled($matches[4])) {
continue;
}
$message = new ArcanistLintMessage(); $message = new ArcanistLintMessage();
$message->setPath($path); $message->setPath($path);
$message->setLine($matches[2]); $message->setLine($matches[2]);
@ -106,14 +109,7 @@ final class ArcanistPEP8Linter extends ArcanistLinter {
$message->setCode($matches[4]); $message->setCode($matches[4]);
$message->setName('PEP8 '.$matches[4]); $message->setName('PEP8 '.$matches[4]);
$message->setDescription($matches[5]); $message->setDescription($matches[5]);
if (!$this->isMessageEnabled($matches[4])) {
continue;
}
if ($matches[4][0] == 'E') {
$message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR);
} else {
$message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING);
}
$this->addLintMessage($message); $this->addLintMessage($message);
} }
} }