]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Allow `arc lint --output json --apply-patches`
authorvrana <jakubv@fb.com>
Sat, 11 Feb 2012 05:35:12 +0000 (21:35 -0800)
committervrana <jakubv@fb.com>
Sat, 11 Feb 2012 16:49:01 +0000 (08:49 -0800)
Summary:
I want to use JSON which allows me to automatically open the files in editor.
I also want to apply patches, especially those modifying __init__.php.
I see no reason why these options should be mutually exclusive.

Also output nothing for okay result which is more standard and better parsable.

Test Plan:
arc lint --output json
arc lint --output json --never-apply-patches # same as above
arc lint --output json --apply-patches

Reviewers: aran, epriestley

Reviewed By: epriestley

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1599

src/lint/renderer/ArcanistLintJSONRenderer.php
src/workflow/lint/ArcanistLintWorkflow.php

index 5cde7cce28ea03deeade0503077a8e8f354e85f1..ddaa70c6bee7f37ab9534373766a21d46bf771d3 100644 (file)
@@ -52,6 +52,6 @@ final class ArcanistLintJSONRenderer {
   }
 
   public function renderOkayResult() {
-    return "\n";
+    return "";
   }
 }
index 8dc5c93772f7c3250d227c8e3cb11caca968429e..b652ea6d2c937246efc3518c693b739123befa02 100644 (file)
@@ -185,14 +185,7 @@ EOTEXT
       case 'json':
         $renderer = new ArcanistLintJSONRenderer();
         $prompt_patches = false;
-        $apply_patches = false;
-        if ($this->getArgument('never-apply-patches') ||
-            $this->getArgument('apply-patches')) {
-          throw new ArcanistUsageException(
-            "Automatic patch suggestion is disabled when using JSON output. ".
-            "Remove --never-apply-patches or --apply-patches."
-          );
-        }
+        $apply_patches = $this->getArgument('apply-patches');
         break;
       case 'summary':
         $renderer = new ArcanistLintSummaryRenderer();