]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't bail on no effect exception
authorvrana <jakubv@fb.com>
Thu, 24 Jan 2013 22:45:21 +0000 (14:45 -0800)
committervrana <jakubv@fb.com>
Fri, 25 Jan 2013 00:07:50 +0000 (16:07 -0800)
Summary: The main reason for this is to not exit with 1 when no paths are lintable (which is more success than failure).

Test Plan:
Returned empty array from `buildLinters()`, then:

  $ arc lint
  $ echo $? # 0

Reviewers: epriestley

Reviewed By: epriestley

CC: wez, aran, Korvin
Differential Revision: https://secure.phabricator.com/D4625

scripts/arcanist.php
src/workflow/ArcanistDiffWorkflow.php

index 292c74e46065704475b14a69eb810c52c40f0019..bf395821aa97fd00a6bd54459cb19dd8f8b86802 100755 (executable)
@@ -263,6 +263,9 @@ try {
   $config->didRunWorkflow($command, $workflow, $err);
   exit((int)$err);
 
+} catch (ArcanistNoEffectException $ex) {
+  echo $ex->getMessage()."\n";
+
 } catch (Exception $ex) {
   $is_usage = ($ex instanceof ArcanistUsageException);
   if ($is_usage) {
index 3f9ae74e11d10b38a3f1e740fc875b48edee9ec7..68b0914c6a014c17adb434452d2ea5f3c04a18a1 100644 (file)
@@ -1336,7 +1336,7 @@ EOTEXT
     } catch (ArcanistNoEngineException $ex) {
       $this->console->writeOut("No lint engine configured for this project.\n");
     } catch (ArcanistNoEffectException $ex) {
-      $this->console->writeOut("No paths to lint.\n");
+      $this->console->writeOut($ex->getMessage()."\n");
     }
 
     return null;
@@ -1411,7 +1411,7 @@ EOTEXT
       $this->console->writeOut(
         "No unit test engine is configured for this project.\n");
     } catch (ArcanistNoEffectException $ex) {
-      $this->console->writeOut("No tests to run.\n");
+      $this->console->writeOut($ex->getMessage()."\n");
     }
 
     return null;