diff --git a/src/lint/linter/ArcanistTextLinter.php b/src/lint/linter/ArcanistTextLinter.php index 2f81b039..87a2d8a7 100644 --- a/src/lint/linter/ArcanistTextLinter.php +++ b/src/lint/linter/ArcanistTextLinter.php @@ -245,7 +245,7 @@ final class ArcanistTextLinter extends ArcanistLinter { $matches = null; $preg = preg_match_all( - '/ +$/m', + '/[[:blank:]]+$/m', $data, $matches, PREG_OFFSET_CAPTURE); diff --git a/src/lint/linter/__tests__/text/trailing-whitespace.lint-test b/src/lint/linter/__tests__/text/trailing-whitespace-1.lint-test similarity index 100% rename from src/lint/linter/__tests__/text/trailing-whitespace.lint-test rename to src/lint/linter/__tests__/text/trailing-whitespace-1.lint-test diff --git a/src/lint/linter/__tests__/text/trailing-whitespace-2.lint-test b/src/lint/linter/__tests__/text/trailing-whitespace-2.lint-test new file mode 100644 index 00000000..0863c187 --- /dev/null +++ b/src/lint/linter/__tests__/text/trailing-whitespace-2.lint-test @@ -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. diff --git a/src/lint/linter/__tests__/text/trailing-whitespace-3.lint-test b/src/lint/linter/__tests__/text/trailing-whitespace-3.lint-test new file mode 100644 index 00000000..e92f7bbd --- /dev/null +++ b/src/lint/linter/__tests__/text/trailing-whitespace-3.lint-test @@ -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.