diff --git a/ArcanistLintEngine.php b/ArcanistLintEngine.php index 41e1153..255b049 100644 --- a/ArcanistLintEngine.php +++ b/ArcanistLintEngine.php @@ -165,22 +165,6 @@ abstract class ArcanistLintEngine { $stopped = array(); $linters = $this->buildLinters(); - if (!$linters) { - throw new ArcanistNoEffectException("No linters to run."); - } - - $have_paths = false; - foreach ($linters as $linter) { - if ($linter->getPaths()) { - $have_paths = true; - break; - } - } - - if (!$have_paths) { - throw new ArcanistNoEffectException("No paths are lintable."); - } - $exceptions = array(); foreach ($linters as $linter_name => $linter) { try { @@ -251,6 +235,22 @@ abstract class ArcanistLintEngine { } } + if (!$linters) { + throw new ArcanistNoEffectException("No linters to run."); + } + + $have_paths = false; + foreach ($linters as $linter) { + if ($linter->getPaths()) { + $have_paths = true; + break; + } + } + + if (!$have_paths) { + throw new ArcanistNoEffectException("No paths are lintable."); + } + if ($exceptions) { throw new PhutilAggregateException('Some linters failed:', $exceptions); }