mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 00:32:41 +01:00
Fix issue where message contained % but wasn't intended for use with parameters
Summary: This fixes an issue with the C# linter where a message could be returned from cslint that wasn't intended for use with parameters. This just ensures there's enough parameters so that it won't crash (and consequently ignore lint messages). Test Plan: Ran the linter, it didn't crash. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9116
This commit is contained in:
parent
d484b60295
commit
fcdacc28b8
1 changed files with 5 additions and 2 deletions
|
@ -207,8 +207,11 @@ final class ArcanistCSharpLinter extends ArcanistLinter {
|
|||
$message->setChar($issue->Column);
|
||||
$message->setOriginalText($issue->OriginalText);
|
||||
$message->setReplacementText($issue->ReplacementText);
|
||||
$message->setDescription(
|
||||
vsprintf($issue->Index->Message, $issue->Parameters));
|
||||
$desc = @vsprintf($issue->Index->Message, $issue->Parameters);
|
||||
if ($desc === false) {
|
||||
$desc = $issue->Index->Message;
|
||||
}
|
||||
$message->setDescription($desc);
|
||||
$severity = ArcanistLintSeverity::SEVERITY_ADVICE;
|
||||
switch ($issue->Index->Severity) {
|
||||
case 0:
|
||||
|
|
Loading…
Reference in a new issue