Changeset View
Changeset View
Standalone View
Standalone View
src/lint/engine/ArcanistLintEngine.php
| Show All 33 Lines | |||||
| * | * | ||||
| * arc lint --engine ExampleLintEngine --lintall some_file.py | * arc lint --engine ExampleLintEngine --lintall some_file.py | ||||
| * | * | ||||
| * ...which will show you all the lint issues raised in the file. | * ...which will show you all the lint issues raised in the file. | ||||
| * | * | ||||
| * See @{article@phabricator:Arcanist User Guide: Customizing Lint, Unit Tests | * See @{article@phabricator:Arcanist User Guide: Customizing Lint, Unit Tests | ||||
| * and Workflows} for more information about configuring lint engines. | * and Workflows} for more information about configuring lint engines. | ||||
| * | * | ||||
| * @group lint | |||||
| * @stable | * @stable | ||||
| */ | */ | ||||
| abstract class ArcanistLintEngine { | abstract class ArcanistLintEngine { | ||||
| protected $workingCopy; | protected $workingCopy; | ||||
| protected $paths = array(); | protected $paths = array(); | ||||
| protected $fileData = array(); | protected $fileData = array(); | ||||
| ▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | final public function run() { | ||||
| return $this->results; | return $this->results; | ||||
| } | } | ||||
| final public function isSeverityEnabled($severity) { | final public function isSeverityEnabled($severity) { | ||||
| $minimum = $this->minimumSeverity; | $minimum = $this->minimumSeverity; | ||||
| return ArcanistLintSeverity::isAtLeastAsSevere($severity, $minimum); | return ArcanistLintSeverity::isAtLeastAsSevere($severity, $minimum); | ||||
| } | } | ||||
| final private function shouldUseCache($cache_granularity, | final private function shouldUseCache( | ||||
| $cache_granularity, | |||||
| $repository_version) { | $repository_version) { | ||||
| if ($this->commitHookMode) { | if ($this->commitHookMode) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| switch ($cache_granularity) { | switch ($cache_granularity) { | ||||
| case ArcanistLinter::GRANULARITY_FILE: | case ArcanistLinter::GRANULARITY_FILE: | ||||
| return true; | return true; | ||||
| case ArcanistLinter::GRANULARITY_DIRECTORY: | case ArcanistLinter::GRANULARITY_DIRECTORY: | ||||
| case ArcanistLinter::GRANULARITY_REPOSITORY: | case ArcanistLinter::GRANULARITY_REPOSITORY: | ||||
| ▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | abstract class ArcanistLintEngine { | ||||
| * @param wild Resource. | * @param wild Resource. | ||||
| * @return this | * @return this | ||||
| */ | */ | ||||
| public function setLinterResource($key, $value) { | public function setLinterResource($key, $value) { | ||||
| $this->linterResources[$key] = $value; | $this->linterResources[$key] = $value; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| } | } | ||||