From 6f7bedaceb6857a084b4914679a43fdedfb720da Mon Sep 17 00:00:00 2001 From: Aviv Eyal Date: Tue, 5 May 2015 14:03:01 -0700 Subject: [PATCH] Fix linter config check 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 | 6 ++---- src/lint/linter/ArcanistExternalLinter.php | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php b/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php index 352bbc95..73651083 100644 --- a/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php +++ b/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php @@ -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; diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php index b8aceb8e..418a434a 100644 --- a/src/lint/linter/ArcanistExternalLinter.php +++ b/src/lint/linter/ArcanistExternalLinter.php @@ -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) {