Changeset View
Changeset View
Standalone View
Standalone View
src/lint/engine/ArcanistSingleLintEngine.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Run a single linter on every path unconditionally. This is a glue engine for | * Run a single linter on every path unconditionally. This is a glue engine for | ||||
| * linters like @{class:ArcanistScriptAndRegexLinter}, if you are averse to | * linters like @{class:ArcanistScriptAndRegexLinter}, if you are averse to | ||||
| * writing a phutil library. Your linter will receive every path, including | * writing a phutil library. Your linter will receive every path, including | ||||
| * paths which have been moved or deleted. | * paths which have been moved or deleted. | ||||
| * | * | ||||
| * Set which linter should be run by configuring `lint.engine.single.linter` in | * Set which linter should be run by configuring `lint.engine.single.linter` in | ||||
| * `.arcconfig` or user config. | * `.arcconfig` or user config. | ||||
| * | |||||
| * @group linter | |||||
| */ | */ | ||||
| final class ArcanistSingleLintEngine extends ArcanistLintEngine { | final class ArcanistSingleLintEngine extends ArcanistLintEngine { | ||||
| public function buildLinters() { | public function buildLinters() { | ||||
| $key = 'lint.engine.single.linter'; | $key = 'lint.engine.single.linter'; | ||||
| $linter_name = $this->getConfigurationManager() | $linter_name = $this->getConfigurationManager() | ||||
| ->getConfigFromAnySource($key); | ->getConfigFromAnySource($key); | ||||
| Show All 34 Lines | foreach ($paths as $key => $path) { | ||||
| } | } | ||||
| } | } | ||||
| $linter = newv($linter_name, array()); | $linter = newv($linter_name, array()); | ||||
| $linter->setPaths($paths); | $linter->setPaths($paths); | ||||
| return array($linter); | return array($linter); | ||||
| } | } | ||||
| } | } | ||||