From: vrana Date: Sat, 11 Feb 2012 05:35:12 +0000 (-0800) Subject: Allow `arc lint --output json --apply-patches` X-Git-Tag: conduit-4~151 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e8ca66ead4ed73a8552c11dc66ab744e61e39f8f;p=arcanist.git Allow `arc lint --output json --apply-patches` 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 --- diff --git a/src/lint/renderer/ArcanistLintJSONRenderer.php b/src/lint/renderer/ArcanistLintJSONRenderer.php index 5cde7cce..ddaa70c6 100644 --- a/src/lint/renderer/ArcanistLintJSONRenderer.php +++ b/src/lint/renderer/ArcanistLintJSONRenderer.php @@ -52,6 +52,6 @@ final class ArcanistLintJSONRenderer { } public function renderOkayResult() { - return "\n"; + return ""; } } diff --git a/src/workflow/lint/ArcanistLintWorkflow.php b/src/workflow/lint/ArcanistLintWorkflow.php index 8dc5c937..b652ea6d 100644 --- a/src/workflow/lint/ArcanistLintWorkflow.php +++ b/src/workflow/lint/ArcanistLintWorkflow.php @@ -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();