]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix linter config check
authorAviv Eyal <avivey@gmail.com>
Tue, 5 May 2015 21:03:01 +0000 (14:03 -0700)
committerepriestley <git@epriestley.com>
Tue, 5 May 2015 21:03:01 +0000 (14:03 -0700)
Summary: Fixes T6311 and T5124 by returning all configured linters from `buildLinter()`, and making `ArcanistExternalLinter::checkBinaryConfiguration()` not crash if there's no executable to run.

Test Plan: `arc linters` in rP shows "Configured" and "ERROR" as appropriate; Adding a broken linter to `.arclint` in rARC doesn't invoke it's not actually needed, and prints error if it is.

Reviewers: joshuaspence, epriestley, #blessed_reviewers

Reviewed By: joshuaspence, epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T6311

Differential Revision: https://secure.phabricator.com/D10773

src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
src/lint/linter/ArcanistExternalLinter.php

index 352bbc95aedca1db42d505e5d8c5882d8e713cdd..73651083a32480909965cad85bcad5144565d653 100644 (file)
@@ -129,10 +129,8 @@ final class ArcanistConfigurationDrivenLintEngine extends ArcanistLintEngine {
         "%s\n",
         pht("Found %d matching paths for linter '%s'.", count($paths), $name));
 
-      if ($paths) {
-        $linter->setPaths($paths);
-        $built_linters[] = $linter;
-      }
+      $linter->setPaths($paths);
+      $built_linters[] = $linter;
     }
 
     return $built_linters;
index b8aceb8e2e61da874140b7043764f5f5ed4af72b..418a434a7213a594c44ddbc6e8c0431c2ff37c4d 100644 (file)
@@ -299,6 +299,12 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
   }
 
   public function getCacheVersion() {
+    try {
+      $this->checkBinaryConfiguration();
+    } catch (ArcanistMissingLinterException $e) {
+      return null;
+    }
+
     $version = $this->getVersion();
 
     if ($version) {