mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
Improve the "inline HTML" linter rule
Summary: Improve `ArcanistInlineHTMLXHPASTLinterRule` such that it doesn't raise duplicate warnings. Also be a bit more lax with whitespace. Test Plan: Unit tests now pass. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D13896
This commit is contained in:
parent
fe8ed2a6f8
commit
4404e66735
3 changed files with 7 additions and 0 deletions
|
@ -22,9 +22,14 @@ final class ArcanistInlineHTMLXHPASTLinterRule
|
|||
continue;
|
||||
}
|
||||
|
||||
if (preg_match('/^\s*$/', $html->getValue())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->raiseLintAtToken(
|
||||
$html,
|
||||
pht('PHP files must only contain PHP code.'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,3 +2,4 @@
|
|||
|
||||
This shouldn't fatal the parser.
|
||||
~~~~~~~~~~
|
||||
disabled:2:1
|
||||
|
|
|
@ -3,6 +3,7 @@ garbage garbage
|
|||
|
||||
?>
|
||||
~~~~~~~~~~
|
||||
disabled:1:1
|
||||
error:1:1
|
||||
~~~~~~~~~~
|
||||
garbage garbage
|
||||
|
|
Loading…
Reference in a new issue