From e3a556af9b26ec746d613ccb32dff86dc542e3d2 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 18 May 2015 07:48:03 +1000 Subject: [PATCH] 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 --- src/lint/linter/ArcanistXHPASTLinter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. } -- 2.43.0