From 2cf13932197f00538cd4c33273c03e7ca92244e6 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 10 Apr 2011 16:05:44 -0700 Subject: [PATCH] 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. --- src/lint/engine/base/ArcanistLintEngine.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lint/engine/base/ArcanistLintEngine.php b/src/lint/engine/base/ArcanistLintEngine.php index 7d51b603..053b72aa 100644 --- a/src/lint/engine/base/ArcanistLintEngine.php +++ b/src/lint/engine/base/ArcanistLintEngine.php @@ -172,11 +172,16 @@ abstract class ArcanistLintEngine { } 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])) { - // Only set the data if any linter loaded it. The goal here is to - // avoid binaries when we don't actually care about their contents, - // for performance. + $result->setData($this->fileData[$path]); + } else if ($disk_path) { + // 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]); } } -- 2.43.0