]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Change severity of PEP8 errors to warnings
authorvrana <jakubv@fb.com>
Sun, 4 Nov 2012 04:52:30 +0000 (21:52 -0700)
committervrana <jakubv@fb.com>
Mon, 5 Nov 2012 21:05:13 +0000 (13:05 -0800)
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

index c242680208525d099c92d64ebe32539a5b6f4b91..3e3f49729184ca9609cfc2a4f0412d3b22841a0e 100644 (file)
@@ -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);
     }
   }