From 30b7835c37b56ac9ea1de6b2291b3fb71c9e6853 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Thu, 6 Sep 2018 12:43:34 +1000 Subject: [PATCH] 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 --- src/lint/linter/ArcanistFutureLinter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lint/linter/ArcanistFutureLinter.php b/src/lint/linter/ArcanistFutureLinter.php index d14fe49a..e9df8371 100644 --- a/src/lint/linter/ArcanistFutureLinter.php +++ b/src/lint/linter/ArcanistFutureLinter.php @@ -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; }