]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve `arc lint --output summary`
authorepriestley <git@epriestley.com>
Wed, 18 Dec 2013 22:21:03 +0000 (14:21 -0800)
committerepriestley <git@epriestley.com>
Wed, 18 Dec 2013 22:21:03 +0000 (14:21 -0800)
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

src/lint/renderer/ArcanistLintSummaryRenderer.php

index adeae65ca5a856a11e7f3762666f52b42efb68aa..578e5c20d0d6d48d5a5920bda5ffe5c4ad3c0afb 100644 (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() {