1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-27 17:22:41 +01:00

Fix brace formatting linter rule after XHPAST changes

Summary: Adjusts `ArcanistBraceFormattingXHPASTLinterRule` after changes to the way in which XHPAST parses namespaces. Depends on D14498.

Test Plan: Unit tests are now passing.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14499
This commit is contained in:
Joshua Spence 2015-11-18 07:20:39 +11:00
parent a4dba24c46
commit e3e232530c

View file

@ -61,10 +61,17 @@ final class ArcanistBraceFormattingXHPASTLinterRule
} }
$type = $parent->getTypeName(); $type = $parent->getTypeName();
if ($type != 'n_STATEMENT_LIST' && $type != 'n_DECLARE') { switch ($type) {
$this->raiseLintAtNode( case 'n_DECLARE':
$node, case 'n_NAMESPACE':
pht('Use braces to surround a statement block.')); case 'n_STATEMENT_LIST':
break;
default:
$this->raiseLintAtNode(
$node,
pht('Use braces to surround a statement block.'));
break;
} }
} }