From: vrana Date: Thu, 24 Jan 2013 22:45:21 +0000 (-0800) Subject: Don't bail on no effect exception X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e56f47aed5a0124df008262cb9c45dead4815196;p=arcanist.git Don't bail on no effect exception 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 --- diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 292c74e4..bf395821 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -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) { diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 3f9ae74e..68b0914c 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -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;