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
Unknown Object (File)
Wed, Dec 25, 3:37 PM
Unknown Object (File)
Wed, Dec 25, 3:37 PM
Unknown Object (File)
Wed, Dec 25, 3:37 PM
Unknown Object (File)
Wed, Dec 25, 2:04 PM
Unknown Object (File)
Wed, Dec 25, 1:56 PM
Unknown Object (File)
Mon, Dec 23, 9:48 AM
Unknown Object (File)
Mon, Dec 23, 9:48 AM
Unknown Object (File)
Mon, Dec 23, 9:48 AM
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 456
Build 456: [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).