1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

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
This commit is contained in:
Adam Simpkins 2011-05-17 12:43:49 -07:00
parent 3a559ddd13
commit 952fa69f72

View file

@ -96,6 +96,11 @@ EOTEXT
$engine = $this->getArgument('engine'); $engine = $this->getArgument('engine');
if (!$engine) { if (!$engine) {
$engine = $working_copy->getConfig('lint_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'); $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); PhutilSymbolLoader::loadClass($engine);
$engine = newv($engine, array()); $engine = newv($engine, array());