diff --git a/src/lint/ArcanistLintMessage.php b/src/lint/ArcanistLintMessage.php index cce2ca21..80816fbb 100644 --- a/src/lint/ArcanistLintMessage.php +++ b/src/lint/ArcanistLintMessage.php @@ -21,6 +21,7 @@ final class ArcanistLintMessage { protected $otherLocations = array(); protected $obsolete; protected $granularity; + protected $bypassChangedLineFiltering; public static function newFromDictionary(array $dict) { $message = new ArcanistLintMessage(); @@ -40,6 +41,9 @@ final class ArcanistLintMessage { } $message->setGranularity(idx($dict, 'granularity')); $message->setOtherLocations(idx($dict, 'locations', array())); + if (isset($dict['bypassChangedLineFiltering'])) { + $message->bypassChangedLineFiltering($dict['bypassChangedLineFiltering']); + } return $message; } @@ -56,6 +60,7 @@ final class ArcanistLintMessage { 'replacement' => $this->getReplacementText(), 'granularity' => $this->getGranularity(), 'locations' => $this->getOtherLocations(), + 'bypassChangedLineFiltering' => $this->shouldBypassChangedLineFiltering(), ); } @@ -213,4 +218,13 @@ final class ArcanistLintMessage { return $this; } + public function setBypassChangedLineFiltering($bypass_changed_lines) { + $this->bypassChangedLineFiltering = $bypass_changed_lines; + return $this; + } + + public function shouldBypassChangedLineFiltering() { + return $this->bypassChangedLineFiltering; + } + } diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php index b08f5e19..3cb5dbc5 100644 --- a/src/lint/engine/ArcanistLintEngine.php +++ b/src/lint/engine/ArcanistLintEngine.php @@ -411,7 +411,9 @@ abstract class ArcanistLintEngine { // path is a directory or a binary file so we should not exclude // warnings. - if (!$this->changedLines || $message->isError()) { + if (!$this->changedLines || + $message->isError() || + $message->shouldBypassChangedLineFiltering()) { return true; }