From edb6a3838902bd0bb65edf051dc7838456104e52 Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 28 Mar 2012 21:38:31 -0700 Subject: [PATCH] Avoid double indenting in console wrapping Summary: D2016 changed the behavior of `phutil_console_wrap()`. The new behavior is better so I am fixing callsites instead of the function. Test Plan: arc help help Verify that the options descriptions is not indented with 28 spaces. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2047 --- src/lint/renderer/ArcanistLintRenderer.php | 3 +-- src/workflow/diff/ArcanistDiffWorkflow.php | 2 +- src/workflow/help/ArcanistHelpWorkflow.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lint/renderer/ArcanistLintRenderer.php b/src/lint/renderer/ArcanistLintRenderer.php index fa966fe1..baa1e116 100644 --- a/src/lint/renderer/ArcanistLintRenderer.php +++ b/src/lint/renderer/ArcanistLintRenderer.php @@ -45,8 +45,7 @@ final class ArcanistLintRenderer { $description = phutil_console_wrap($message->getDescription(), 4); $text[] = phutil_console_format( - " ** %s ** (%s) __%s__\n". - " %s\n", + " ** %s ** (%s) __%s__\n%s\n", $severity, $code, $name, diff --git a/src/workflow/diff/ArcanistDiffWorkflow.php b/src/workflow/diff/ArcanistDiffWorkflow.php index 401f7edd..1959d447 100644 --- a/src/workflow/diff/ArcanistDiffWorkflow.php +++ b/src/workflow/diff/ArcanistDiffWorkflow.php @@ -624,7 +624,7 @@ EOTEXT "\n\n". "Modified 'svn:externals' files:". "\n\n". - ' '.phutil_console_wrap(implode("\n", $warn_externals), 8)); + phutil_console_wrap(implode("\n", $warn_externals), 8)); $prompt = "Generate a diff (with just local changes) anyway?"; if (!phutil_console_confirm($prompt)) { throw new ArcanistUserAbortException(); diff --git a/src/workflow/help/ArcanistHelpWorkflow.php b/src/workflow/help/ArcanistHelpWorkflow.php index 1ff79ee8..47de7394 100644 --- a/src/workflow/help/ArcanistHelpWorkflow.php +++ b/src/workflow/help/ArcanistHelpWorkflow.php @@ -138,7 +138,7 @@ EOTEXT $docs = 'This option is not documented.'; } $docs = phutil_console_wrap($docs, 14); - $optref[] = " {$docs}\n"; + $optref[] = "{$docs}\n"; } if ($optref) { $optref = implode("\n", $optref);