From: Joshua Spence Date: Sun, 17 May 2015 21:48:03 +0000 (+1000) Subject: Improve error message from ArcanistXHPASTLinter::LINT_FORMATTED_STRING X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e3a556af9b26ec746d613ccb32dff86dc542e3d2;p=arcanist.git Improve error message from ArcanistXHPASTLinter::LINT_FORMATTED_STRING Summary: Currently the error message from `ArcanistXHPASTLinter::LINT_FORMATTED_STRING` is slightly wrong, mentioning `xsprintf` instead of the actual `sprintf`-style function which was used. This diff changes the error message to be more correct. Test Plan: Linted a file containing `sprintf('%s')` and saw a reasonable lint message. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12871 --- diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index 5f08f150..e280ff8d 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -3450,7 +3450,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter { $this->raiseLintAtNode( $call, self::LINT_FORMATTED_STRING, - $ex->getMessage()); + str_replace('xsprintf', $name, $ex->getMessage())); } catch (InvalidArgumentException $ex) { // Ignore. }