mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +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->setChar($issue->Column);
|
||||||
$message->setOriginalText($issue->OriginalText);
|
$message->setOriginalText($issue->OriginalText);
|
||||||
$message->setReplacementText($issue->ReplacementText);
|
$message->setReplacementText($issue->ReplacementText);
|
||||||
$message->setDescription(
|
$desc = @vsprintf($issue->Index->Message, $issue->Parameters);
|
||||||
vsprintf($issue->Index->Message, $issue->Parameters));
|
if ($desc === false) {
|
||||||
|
$desc = $issue->Index->Message;
|
||||||
|
}
|
||||||
|
$message->setDescription($desc);
|
||||||
$severity = ArcanistLintSeverity::SEVERITY_ADVICE;
|
$severity = ArcanistLintSeverity::SEVERITY_ADVICE;
|
||||||
switch ($issue->Index->Severity) {
|
switch ($issue->Index->Severity) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
Loading…
Reference in a new issue