mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-10 06:41:04 +01:00
459251a8d0
Summary: Also simplify creating futures. Test Plan: This diff. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, s.o.butler Differential Revision: https://secure.phabricator.com/D5042
34 lines
801 B
PHP
34 lines
801 B
PHP
<?php
|
|
|
|
abstract class ArcanistFutureLinter extends ArcanistLinter {
|
|
|
|
private $futures;
|
|
|
|
abstract protected function buildFutures(array $paths);
|
|
abstract protected function resolveFuture($path, Future $future);
|
|
|
|
protected function getFuturesLimit() {
|
|
return 8;
|
|
}
|
|
|
|
public function willLintPaths(array $paths) {
|
|
$limit = $this->getFuturesLimit();
|
|
$this->futures = Futures(array())->limit($limit);
|
|
foreach ($this->buildFutures($paths) as $path => $future) {
|
|
$this->futures->addFuture($future, $path);
|
|
}
|
|
}
|
|
|
|
public function lintPath($path) {
|
|
}
|
|
|
|
public function didRunLinters() {
|
|
if ($this->futures) {
|
|
foreach ($this->futures as $path => $future) {
|
|
$this->willLintPath($path);
|
|
$this->resolveFuture($path, $future);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|