From: vrana Date: Fri, 11 Jan 2013 23:23:47 +0000 (-0800) Subject: Display other locations of lint errors in console renderer X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e8decd20624e6f2ca5a0c528b77b12af75f56c26;p=arcanist.git 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 --- 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);