Changeset View
Changeset View
Standalone View
Standalone View
arcanist/linter/engine/RunOnceLintEngine.php
- This file was added.
<?php | |||||
final class RunOnceLintEngine extends BitcoinABCConfigurationDrivenLintEngine { | |||||
public function buildLinters() { | |||||
$this->configurationFile = '.runonce.arclint'; | |||||
return parent::buildLinters(); | |||||
} | |||||
protected function matchPaths( | |||||
array $paths, | |||||
array $include, | |||||
array $exclude, | |||||
array $global_exclude) { | |||||
$paths = parent::matchPaths($paths, $include, $exclude, $global_exclude); | |||||
/* | |||||
* We want to make sure that at least one path matches the regex, otherwise | |||||
* the linter should not run. | |||||
* But if there are multiple paths, only associate one of them to make the | |||||
* linter run only once. | |||||
*/ | |||||
return empty($paths)? array() : array($paths[0]); | |||||
} | |||||
} |