1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-24 22:40:55 +01:00

Trigger bad charset lint warning only once per line

Summary:
Makes lots of noise:
{F22758}

Test Plan:
Linted file with several bad characters per line.
Linted file with one bad character per line.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3896
This commit is contained in:
vrana 2012-11-05 15:52:19 -08:00
parent 0938091a99
commit d53dcbe952

View file

@ -136,8 +136,9 @@ final class ArcanistTextLinter extends ArcanistLinter {
$data = $this->getData($path); $data = $this->getData($path);
$matches = null; $matches = null;
$bad = '[^\x09\x0A\x20-\x7E]';
$preg = preg_match_all( $preg = preg_match_all(
'/[^\x09\x0A\x20-\x7E]+/', "/{$bad}(.*{$bad})?/",
$data, $data,
$matches, $matches,
PREG_OFFSET_CAPTURE); PREG_OFFSET_CAPTURE);