]> khamidou — GitHub mirrors - arcanist.git/commitdiff
don't stopAllLinters() for disabled error
authorChris Piro <cpiro@airtime.com>
Thu, 17 Nov 2011 05:53:47 +0000 (21:53 -0800)
committerChris Piro <cpiro@airtime.com>
Thu, 17 Nov 2011 22:06:49 +0000 (14:06 -0800)
Summary: if we don't care and don't expect it to break all other linters then
continue

Test Plan: ##arc lint --trace## on a commit with non-ascii characters, saw other
linters continue

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley, cpiro
Differential Revision: 1122

src/lint/linter/base/ArcanistLinter.php
src/lint/linter/text/ArcanistTextLinter.php

index 4b3bbe23d8e2a3bc299dff585c911e479b145a9f..67bfd6c091fd58392aebda74fedb41a753862859 100644 (file)
@@ -104,6 +104,11 @@ abstract class ArcanistLinter {
     return ArcanistLintSeverity::SEVERITY_ERROR;
   }
 
+  public function isMessageEnabled($code) {
+    return ($this->getLintMessageSeverity($code) !==
+            ArcanistLintSeverity::SEVERITY_DISABLED);
+  }
+
   public function getLintMessageName($code) {
     $map = $this->getLintNameMap();
     if (isset($map[$code])) {
index 5946d993b94707d1ba0a62f961d984e3a08b6e5e..a3c1df301fbde095de8b7562cc2596596dd8e4aa 100644 (file)
@@ -101,7 +101,9 @@ class ArcanistTextLinter extends ArcanistLinter {
         self::LINT_DOS_NEWLINE,
         'You must use ONLY Unix linebreaks ("\n") in source code.',
         "\r");
-      $this->stopAllLinters();
+      if ($this->isMessageEnabled(self::LINT_DOS_NEWLINE)) {
+        $this->stopAllLinters();
+      }
     }
   }
 
@@ -170,7 +172,9 @@ class ArcanistTextLinter extends ArcanistLinter {
         $string);
     }
 
-    $this->stopAllLinters();
+    if ($this->isMessageEnabled(self::LINT_BAD_CHARSET)) {
+      $this->stopAllLinters();
+    }
   }
 
   protected function lintTrailingWhitespace($path) {