]> khamidou — GitHub mirrors - arcanist.git/commitdiff
[arcanist] respect severity disabled in PEP8 linter
authorNick Harper <nharper@fb.com>
Fri, 9 Mar 2012 05:22:36 +0000 (21:22 -0800)
committerNick Harper <nharper@fb.com>
Fri, 9 Mar 2012 19:19:17 +0000 (11:19 -0800)
Summary:
This allows for disabling certain PEP8 linter errors by calling
setCustomSeverityMap on an ArcanistPEP8Linter. However, any custom severities
besides disabled will be ignored.

Test Plan: arc lint

Reviewers: epriestley, andrewjcg

Reviewed By: epriestley

CC: jungejason, aran, epriestley
Differential Revision: https://secure.phabricator.com/D1839

src/lint/linter/pep8/ArcanistPEP8Linter.php

index 9e5aa6b2935f384b47d52806e5df0690ea9d4a16..b9778de4c22285f8bf8cfcd80fac57ec8a3ecde5 100644 (file)
@@ -122,6 +122,9 @@ 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 {