1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Allow ArcanistLinter to load files not directly affected by lint

Summary:
This is necessary for the Javelin linters. The libphutil and flib linters do it
implicitly, so there's no real tradeoff here.

Test Plan:
Ran javelin linters.

Reviewed By: tuomaspelkonen
Reviewers: tomo, aran, jungejason, tuomaspelkonen
CC: aran, tuomaspelkonen, epriestley
Differential Revision: 238
This commit is contained in:
epriestley 2011-05-06 08:34:18 -07:00
parent 71d233410b
commit 23afdb99f0
2 changed files with 10 additions and 2 deletions

View file

@ -67,12 +67,17 @@ abstract class ArcanistLinter {
protected function getData($path) { protected function getData($path) {
if (!array_key_exists($path, $this->data)) { if (!array_key_exists($path, $this->data)) {
throw new Exception("Data is not provided for path '{$path}'!"); $disk_path = $this->getEngine()->getFilePathOnDisk($path);
if ($disk_path) {
$this->data[$path] = Filesystem::readFile($disk_path);
} else {
throw new Exception("Data is not provided for path '{$path}'!");
}
} }
return $this->data[$path]; return $this->data[$path];
} }
public function setEngine($engine) { public function setEngine(ArcanistLintEngine $engine) {
$this->engine = $engine; $this->engine = $engine;
return $this; return $this;
} }

View file

@ -5,8 +5,11 @@
*/ */
phutil_require_module('arcanist', 'lint/message'); phutil_require_module('arcanist', 'lint/message');
phutil_require_module('arcanist', 'lint/severity'); phutil_require_module('arcanist', 'lint/severity');
phutil_require_module('phutil', 'filesystem');
phutil_require_source('ArcanistLinter.php'); phutil_require_source('ArcanistLinter.php');