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

Load files which we don't directly examine, since there are some common cases

where we either generate an entire file or an external script examines it.
This commit is contained in:
epriestley 2011-04-10 16:05:44 -07:00
parent d87fda8561
commit 2cf1393219

View file

@ -172,11 +172,16 @@ abstract class ArcanistLintEngine {
} }
foreach ($this->results as $path => $result) { foreach ($this->results as $path => $result) {
$result->setFilePathOnDisk($this->getFilePathOnDisk($path)); $disk_path = $this->getFilePathOnDisk($path);
$result->setFilePathOnDisk($disk_path);
if (isset($this->fileData[$path])) { if (isset($this->fileData[$path])) {
// Only set the data if any linter loaded it. The goal here is to $result->setData($this->fileData[$path]);
// avoid binaries when we don't actually care about their contents, } else if ($disk_path) {
// for performance. // TODO: this may cause us to, e.g., load a large binary when we only
// raised an error about its filename. We could refine this by looking
// through the lint messages and doing this load only if any of them
// have original/replacement text or something like that.
$this->fileData[$path] = Filesystem::readFile($path);
$result->setData($this->fileData[$path]); $result->setData($this->fileData[$path]);
} }
} }