From e8ca66ead4ed73a8552c11dc66ab744e61e39f8f Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 10 Feb 2012 21:35:12 -0800 Subject: [PATCH] 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 --- src/lint/renderer/ArcanistLintJSONRenderer.php | 2 +- src/workflow/lint/ArcanistLintWorkflow.php | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) 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(); -- 2.43.0