From e8decd20624e6f2ca5a0c528b77b12af75f56c26 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 11 Jan 2013 15:23:47 -0800 Subject: [PATCH] Display other locations of lint errors in console renderer Test Plan: Created function named `f_a`, manually set other location. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4412 --- src/lint/renderer/ArcanistLintConsoleRenderer.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lint/renderer/ArcanistLintConsoleRenderer.php b/src/lint/renderer/ArcanistLintConsoleRenderer.php index 7a13deab..3f5bcd53 100644 --- a/src/lint/renderer/ArcanistLintConsoleRenderer.php +++ b/src/lint/renderer/ArcanistLintConsoleRenderer.php @@ -36,14 +36,24 @@ final class ArcanistLintConsoleRenderer implements ArcanistLintRenderer { $message->getSeverity()); $code = $message->getCode(); $name = $message->getName(); - $description = phutil_console_wrap($message->getDescription(), 4); + $description = $message->getDescription(); + + if ($message->getOtherLocations()) { + $locations = array(); + foreach ($message->getOtherLocations() as $location) { + $locations[] = + idx($location, 'path', $path). + (!empty($location['line']) ? ":{$location['line']}" : ""); + } + $description .= "\nOther locations: ".implode(', ', $locations); + } $text[] = phutil_console_format( " ** %s ** (%s) __%s__\n%s\n", $severity, $code, $name, - $description); + phutil_console_wrap($description, 4)); if ($message->hasFileContext()) { $text[] = $this->renderContext($message, $lines);