Changeset View
Changeset View
Standalone View
Standalone View
src/lint/engine/ArcanistLintEngine.php
| Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | abstract class ArcanistLintEngine { | ||||
| final public function getCommitHookMode() { | final public function getCommitHookMode() { | ||||
| return $this->commitHookMode; | return $this->commitHookMode; | ||||
| } | } | ||||
| final public function run() { | final public function run() { | ||||
| $linters = $this->buildLinters(); | $linters = $this->buildLinters(); | ||||
| if (!$linters) { | if (!$linters) { | ||||
| throw new ArcanistNoEffectException("No linters to run."); | throw new ArcanistNoEffectException('No linters to run.'); | ||||
| } | } | ||||
| $linters = msort($linters, 'getLinterPriority'); | $linters = msort($linters, 'getLinterPriority'); | ||||
| foreach ($linters as $linter) { | foreach ($linters as $linter) { | ||||
| $linter->setEngine($this); | $linter->setEngine($this); | ||||
| } | } | ||||
| $have_paths = false; | $have_paths = false; | ||||
| foreach ($linters as $linter) { | foreach ($linters as $linter) { | ||||
| if ($linter->getPaths()) { | if ($linter->getPaths()) { | ||||
| $have_paths = true; | $have_paths = true; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (!$have_paths) { | if (!$have_paths) { | ||||
| throw new ArcanistNoEffectException("No paths are lintable."); | throw new ArcanistNoEffectException('No paths are lintable.'); | ||||
| } | } | ||||
| $versions = array($this->getCacheVersion()); | $versions = array($this->getCacheVersion()); | ||||
| foreach ($linters as $linter) { | foreach ($linters as $linter) { | ||||
| $version = get_class($linter).':'.$linter->getCacheVersion(); | $version = get_class($linter).':'.$linter->getCacheVersion(); | ||||
| $symbols = id(new PhutilSymbolLoader()) | $symbols = id(new PhutilSymbolLoader()) | ||||
| ▲ Show 20 Lines • Show All 344 Lines • Show Last 20 Lines | |||||