From: vrana Date: Sun, 4 Nov 2012 04:52:30 +0000 (-0700) Subject: Change severity of PEP8 errors to warnings X-Git-Tag: conduit-6~40 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=21530fa45996c8643513b25ac5183b466c23193f;p=arcanist.git 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 --- diff --git a/src/lint/linter/ArcanistPEP8Linter.php b/src/lint/linter/ArcanistPEP8Linter.php index c2426802..3e3f4972 100644 --- a/src/lint/linter/ArcanistPEP8Linter.php +++ b/src/lint/linter/ArcanistPEP8Linter.php @@ -99,6 +99,9 @@ final class ArcanistPEP8Linter extends ArcanistLinter { foreach ($matches as $key => $match) { $matches[$key] = trim($match); } + if (!$this->isMessageEnabled($matches[4])) { + continue; + } $message = new ArcanistLintMessage(); $message->setPath($path); $message->setLine($matches[2]); @@ -106,14 +109,7 @@ final class ArcanistPEP8Linter extends ArcanistLinter { $message->setCode($matches[4]); $message->setName('PEP8 '.$matches[4]); $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); } }