diff --git a/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test b/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test index b9f6be44..d15cefb5 100644 --- a/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test +++ b/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test @@ -1,5 +1,4 @@ This shouldn't fatal the parser. ~~~~~~~~~~ -error:1:10 diff --git a/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test b/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test index e749bfa6..7fb52e73 100644 --- a/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test +++ b/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test @@ -1,12 +1,11 @@ garbage garbage ~~~~~~~~~~ error:1:1 -error:4:1 ~~~~~~~~~~ garbage garbage diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php index 9a1a9db7..1b943b54 100644 --- a/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php +++ b/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php @@ -1,20 +1,26 @@ '); } public function process(XHPASTNode $root) { + $inline_html = $root->selectDescendantsOfType('n_INLINE_HTML'); + + if ($inline_html) { + return; + } + foreach ($root->selectTokensOfType('T_CLOSE_TAG') as $token) { $this->raiseLintAtToken( $token, pht('Do not use the PHP closing tag, "%s".', '?>')); } } }