From e56f47aed5a0124df008262cb9c45dead4815196 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 24 Jan 2013 14:45:21 -0800 Subject: [PATCH] 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 --- scripts/arcanist.php | 3 +++ src/workflow/ArcanistDiffWorkflow.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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; -- 2.43.0