1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 14:00:55 +01:00

Don't output "OKAY" for arc lint --output json.

Summary: --output json will be used for scripts, so support script writers a
little better.

Test Plan:
arc lint [--output {json, summary}]
arc lint --output json {--apply-patches, --never-apply-patches}

Reviewers: epriestley

Reviewed By: epriestley

CC: jack, aran, epriestley

Maniphest Tasks: T675

Differential Revision: 1220
This commit is contained in:
adonohue 2011-12-15 10:02:29 -08:00
parent f75cf71c9e
commit 72ee0ced4f
4 changed files with 24 additions and 2 deletions

View file

@ -50,4 +50,8 @@ class ArcanistLintJSONRenderer {
return json_encode($output)."\n";
}
public function renderOkayResult() {
return "\n";
}
}

View file

@ -197,4 +197,9 @@ class ArcanistLintRenderer {
$line,
$data);
}
public function renderOkayResult() {
return
phutil_console_format("<bg:green>** OKAY **</bg> No lint warnings.\n");
}
}

View file

@ -40,4 +40,9 @@ class ArcanistLintSummaryRenderer {
return implode("\n", $text);
}
public function renderOkayResult() {
return
phutil_console_format("<bg:green>** OKAY **</bg> No lint warnings.\n");
}
}

View file

@ -202,6 +202,15 @@ EOTEXT
switch ($this->getArgument('output')) {
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."
);
}
break;
case 'summary':
$renderer = new ArcanistLintSummaryRenderer();
@ -293,8 +302,7 @@ EOTEXT
if (!$this->getParentWorkflow()) {
if ($result_code == self::RESULT_OKAY) {
echo phutil_console_format(
"<bg:green>** OKAY **</bg> No lint warnings.\n");
echo $renderer->renderOkayResult();
}
}