Page MenuHomePhabricator

Fix issue where message contained % but wasn't intended for use with parameters
ClosedPublic

Authored by hach-que on May 14 2014, 7:41 AM.
Tags
None
Referenced Files
F13288965: D9116.diff
Tue, Jun 4, 11:11 AM
F13278928: D9116.id21682.diff
Sat, Jun 1, 7:22 AM
F13278927: D9116.id21681.diff
Sat, Jun 1, 7:21 AM
F13278926: D9116.id21657.diff
Sat, Jun 1, 7:21 AM
F13278898: D9116.id.diff
Sat, Jun 1, 7:03 AM
F13278868: D9116.diff
Sat, Jun 1, 6:32 AM
F13273874: D9116.diff
Fri, May 31, 2:53 AM
F13259658: D9116.diff
Sun, May 26, 10:55 PM
Subscribers

Details

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.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Skipped
Unit
Test Failures
Build Status
Buildable 471
Build 471: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

TimeTest
0 mstestCSSLintLinter
0 mstestPEP8Linter
0 mstestPHPCSLint
0 mstestSpellingLint
0 mstestXHPASTLint
View Full Test Results (5 Failed · 4 Passed · 9 Skipped)

Event Timeline

hach-que retitled this revision from to Fix issue where message contained % but wasn't intended for use with parameters.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.

Is the "crash" a vsprintf() error raising into an exception? Can we do something like this instead?

$message = @vsprintf($pattern, ...);
if ($message === false) {
  $message = $pattern;
}

That will get a bunch of (probably hypothetical) cases right that this misses, I think.

hach-que edited edge metadata.

Feedback from code review

epriestley edited edge metadata.
This revision is now accepted and ready to land.May 15 2014, 12:11 AM
epriestley updated this revision to Diff 21682.
epriestley added a subscriber: Unknown Object (User).

Closed by commit rARCfcdacc28b8a2 (authored by @jamesr, committed by @epriestley).