]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve error message from ArcanistXHPASTLinter::LINT_FORMATTED_STRING
authorJoshua Spence <josh@joshuaspence.com>
Sun, 17 May 2015 21:48:03 +0000 (07:48 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Sun, 17 May 2015 21:48:03 +0000 (07:48 +1000)
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

index 5f08f15060e2c930569bbfbd43e1c4d4fcb175b6..e280ff8db0a48ecd53ae10db47eaf07b80d88bc4 100644 (file)
@@ -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.
       }