From 21530fa45996c8643513b25ac5183b466c23193f Mon Sep 17 00:00:00 2001 From: vrana Date: Sat, 3 Nov 2012 21:52:30 -0700 Subject: [PATCH] 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 --- src/lint/linter/ArcanistPEP8Linter.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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); } } -- 2.43.0