mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-02 09:58:23 +01:00
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
This commit is contained in:
parent
ff73a90482
commit
e8decd2062
1 changed files with 12 additions and 2 deletions
|
@ -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(
|
||||
" **<bg:{$color}> %s </bg>** (%s) __%s__\n%s\n",
|
||||
$severity,
|
||||
$code,
|
||||
$name,
|
||||
$description);
|
||||
phutil_console_wrap($description, 4));
|
||||
|
||||
if ($message->hasFileContext()) {
|
||||
$text[] = $this->renderContext($message, $lines);
|
||||
|
|
Loading…
Add table
Reference in a new issue