HomePhabricator

Allow Script-and-Regex linter to have optional/empty capturing patterns for…

Description

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

Details