1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Improve arc lint --output summary

Summary:
This currently output like this:

  file_a:
  file_b:
  file_c:
    Warning on line 29: blah blah

This isn't especially useful and can't be piped to other tools. Instead, emit output like:

  file_c:29:Warning: blah blah

This is greppable / pipeable.

Test Plan: Ran `arc lint --output summary`.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7788
This commit is contained in:
epriestley 2013-12-18 14:21:03 -08:00
parent 8e177c4db8
commit 35c01eee7b

View file

@ -11,18 +11,16 @@ final class ArcanistLintSummaryRenderer extends ArcanistLintRenderer {
$path = $result->getPath();
$text = array();
$text[] = $path.":";
foreach ($messages as $message) {
$name = $message->getName();
$severity = ArcanistLintSeverity::getStringForSeverity(
$message->getSeverity());
$line = $message->getLine();
$text[] = " {$severity} on line {$line}: {$name}";
$text[] = "{$path}:{$line}:{$severity}: {$name}\n";
}
$text[] = null;
return implode("\n", $text);
return implode("", $text);
}
public function renderOkayResult() {