1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Detect trailing spaces and tabs

Summary: Ref T12655 - this change properly detects trailing spaces or tabs (or combinations of thereof) on end of lines.

Test Plan: Use Text lint with trailing whitespace rule on files with spaces, tabs or combinations of thereof. Should properly detect and fix all those.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, Itms

Maniphest Tasks: T12655

Differential Revision: https://secure.phabricator.com/D17814
This commit is contained in:
Hubert Kowalski 2017-05-03 03:29:14 -07:00 committed by epriestley
parent 27b51e6192
commit 3c4735795a
4 changed files with 31 additions and 1 deletions

View file

@ -245,7 +245,7 @@ final class ArcanistTextLinter extends ArcanistLinter {
$matches = null;
$preg = preg_match_all(
'/ +$/m',
'/[[:blank:]]+$/m',
$data,
$matches,
PREG_OFFSET_CAPTURE);

View file

@ -0,0 +1,15 @@
Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Phasellus sodales nibh erat,
in hendrerit nulla dictum interdum.
~~~~~~~~~~
error:1:28
autofix:1:28
autofix:2:29
autofix:3:29
autofix:4:36
~~~~~~~~~~
Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Phasellus sodales nibh erat,
in hendrerit nulla dictum interdum.

View file

@ -0,0 +1,15 @@
Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Phasellus sodales nibh erat,
in hendrerit nulla dictum interdum.
~~~~~~~~~~
error:1:28
autofix:1:28
autofix:2:29
autofix:3:29
autofix:4:36
~~~~~~~~~~
Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Phasellus sodales nibh erat,
in hendrerit nulla dictum interdum.