1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Allow willLintPaths and didLintPaths to be overridden

Summary: I'm not sure if the upstream will be interested in this change, but we are writing a linter which works by running an external command on the entire repository. This can't be done with `ArcanistExternalLinter` at the moment, which meant that we ended up copy-pasting most of `ArcanistFutureLinter`. This would be a lot easier if we could override `willLintPaths` and `didLintPaths`, but these methods are currently marked as `final`. An alternative solution would be some sort of `ArcanistLinter::transformPath` method.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: faulconbridge, Korvin

Differential Revision: https://secure.phabricator.com/D19630
This commit is contained in:
Joshua Spence 2018-09-06 12:43:34 +10:00
parent e1e93271e6
commit 30b7835c37

View file

@ -11,7 +11,7 @@ abstract class ArcanistFutureLinter extends ArcanistLinter {
return 8;
}
final public function willLintPaths(array $paths) {
public function willLintPaths(array $paths) {
$limit = $this->getFuturesLimit();
$this->futures = id(new FutureIterator(array()))->limit($limit);
foreach ($this->buildFutures($paths) as $path => $future) {
@ -23,7 +23,7 @@ abstract class ArcanistFutureLinter extends ArcanistLinter {
return;
}
final public function didLintPaths(array $paths) {
public function didLintPaths(array $paths) {
if (!$this->futures) {
return;
}