From: Adam Simpkins Date: Tue, 17 May 2011 19:43:49 +0000 (-0700) Subject: lint: fail early if no lint engine is defined X-Git-Tag: conduit-4~338 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=952fa69f72bd226a5e4b1c481780bea7058037d9;p=arcanist.git 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 --- 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());