diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -1975,6 +1975,11 @@ continue; } + $next = $wtoken->getNextToken(); + if ($next && $next->getTypeName() == 'T_COMMENT') { + continue; + } + $this->raiseLintAtToken( $wtoken, self::LINT_BINARY_EXPRESSION_SPACING, diff --git a/src/lint/linter/__tests__/xhpast/space-around-more-operators.lint-test b/src/lint/linter/__tests__/xhpast/space-around-more-operators.lint-test --- a/src/lint/linter/__tests__/xhpast/space-around-more-operators.lint-test +++ b/src/lint/linter/__tests__/xhpast/space-around-more-operators.lint-test @@ -5,6 +5,8 @@ $a .$b; $a. $b; +$a. // This should be okay. +$b; array($x => $y); array($x=>$y); @@ -26,10 +28,10 @@ warning:3:5 warning:4:4 warning:5:3 -warning:10:9 -warning:11:10 warning:12:9 -warning:22:5 +warning:13:10 +warning:14:9 +warning:24:5 ~~~~~~~~~~ $y); array($x => $y);