From 952fa69f72bd226a5e4b1c481780bea7058037d9 Mon Sep 17 00:00:00 2001 From: Adam Simpkins Date: Tue, 17 May 2011 12:43:49 -0700 Subject: [PATCH] lint: fail early if no lint engine is defined Summary: Update the lint workflow to exit immediately it there is no lint engine configured. Previously it scanned the repository to find the paths to check before failing in this case. Scanning the repository can be relatively slow on large repositories. Test Plan: Ran "arc lint" in a large repository with no lint engine configured. Verified that it failed quickly, without scanning the repository first. Reviewed By: jungejason Reviewers: jungejason, epriestley CC: aran, jungejason Differential Revision: 297 --- src/workflow/lint/ArcanistLintWorkflow.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/workflow/lint/ArcanistLintWorkflow.php b/src/workflow/lint/ArcanistLintWorkflow.php index 17a6fe3b..c4bef5be 100644 --- a/src/workflow/lint/ArcanistLintWorkflow.php +++ b/src/workflow/lint/ArcanistLintWorkflow.php @@ -96,6 +96,11 @@ EOTEXT $engine = $this->getArgument('engine'); if (!$engine) { $engine = $working_copy->getConfig('lint_engine'); + if (!$engine) { + throw new ArcanistNoEngineException( + "No lint engine configured for this project. Edit .arcconfig to ". + "specify a lint engine."); + } } $should_lint_all = $this->getArgument('lintall'); @@ -153,12 +158,6 @@ EOTEXT } } - if (!$engine) { - throw new ArcanistNoEngineException( - "No lint engine configured for this project. Edit .arcconfig to ". - "specify a lint engine."); - } - PhutilSymbolLoader::loadClass($engine); $engine = newv($engine, array());