mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +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:
parent
27b51e6192
commit
3c4735795a
4 changed files with 31 additions and 1 deletions
|
@ -245,7 +245,7 @@ final class ArcanistTextLinter extends ArcanistLinter {
|
|||
|
||||
$matches = null;
|
||||
$preg = preg_match_all(
|
||||
'/ +$/m',
|
||||
'/[[:blank:]]+$/m',
|
||||
$data,
|
||||
$matches,
|
||||
PREG_OFFSET_CAPTURE);
|
||||
|
|
|
@ -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.
|
|
@ -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.
|
Loading…
Reference in a new issue