]> khamidou — GitHub mirrors - arcanist.git/commit
Allow Script-and-Regex linter to have optional/empty capturing patterns for char...
authorepriestley <git@epriestley.com>
Mon, 19 Oct 2015 21:35:14 +0000 (14:35 -0700)
committerepriestley <git@epriestley.com>
Mon, 19 Oct 2015 21:35:14 +0000 (14:35 -0700)
commite51e1c3d44640d60c9843c6f41ee06434cadf697
treeb40f976a1934163fc42cc1d4847979f37e9fc8f2
parent6c7def560d5e2b13e0ca428d3874895356056469
Allow Script-and-Regex linter to have optional/empty capturing patterns for char/line

Summary:
See discussion in D13737. If you're using this linter to match messages which //sometimes// have a character, you can get `""` (empty string) matches when the expression doesn't match. We'll complain about these later.

Instead, cast the matches the expected types.

Test Plan: @csilvers confirmed fix, see D13737.

Reviewers: chad, csilvers

Reviewed By: csilvers

Subscribers: spicyj, csilvers

Differential Revision: https://secure.phabricator.com/D14307
src/lint/linter/ArcanistScriptAndRegexLinter.php