1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-20 00:49:11 +02:00

Minor improvement to self member reference linter rule

Summary: Ref T7409. If `::` is surrounded by whitespace tokens and the whitespace token contains a newline character, allow it.

Test Plan: Added test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7409

Differential Revision: https://secure.phabricator.com/D12391
This commit is contained in:
Joshua Spence 2015-04-14 06:29:58 +10:00
parent e233b158f2
commit 51b5c70010
2 changed files with 10 additions and 0 deletions

View file

@ -3459,6 +3459,10 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
foreach ($tokens as $token) {
if ($token->isAnyWhitespace()) {
if (strpos($token->getValue(), "\n") !== false) {
continue;
}
$this->raiseLintAtToken(
$token,
self::LINT_SELF_MEMBER_REFERENCE,

View file

@ -21,6 +21,9 @@ class Foo extends Bar {
}
MyClass :: myMethod();
SomeReallyLongClassName
::someMethod();
~~~~~~~~~~
error:3:7
advice:7:5
@ -54,3 +57,6 @@ class Foo extends Bar {
}
MyClass::myMethod();
SomeReallyLongClassName
::someMethod();