]> khamidou — GitHub mirrors - arcanist.git/commit
Extend `LINT_BRACE_FORMATTING` to warn on missing braces
authorJoshua Spence <josh@joshuaspence.com>
Mon, 8 Dec 2014 12:30:32 +0000 (23:30 +1100)
committerJoshua Spence <josh@joshuaspence.com>
Mon, 8 Dec 2014 12:30:33 +0000 (23:30 +1100)
commitee2070fadbc50d74d0f47071c436330c46ac4e10
treeaf0ffdf513b3000833b057e8057344213116f4ef
parentb46d4ed4ad01556a9400c836dc11cd1432d1f75b
Extend `LINT_BRACE_FORMATTING` to warn on missing braces

Summary: Extend the `ArcanistXHPASTLinter::LINT_BRACE_FORMATTING` rule to raise a warning when `n_STATEMENT` is used without having `n_STATEMENT_LIST` as a parent. Essentially, this means that `if ($x) { do_y(); }` is preferred over `if ($x) do_y();`.

Test Plan: Added some test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10571
src/lint/linter/ArcanistXHPASTLinter.php
src/lint/linter/__tests__/xhpast/conditional-usage.lint-test
src/lint/linter/__tests__/xhpast/creative-brace-use.lint-test
src/lint/linter/__tests__/xhpast/space-after-control-keywords.lint-test