Page MenuHomePhabricator

Extend `LINT_BRACE_FORMATTING` to warn on missing braces
ClosedPublic

Authored by joshuaspence on Sep 26 2014, 5:51 AM.
Tags
None
Referenced Files
F15411277: D10571.diff
Wed, Mar 19, 8:58 AM
F15411226: D10571.diff
Wed, Mar 19, 8:55 AM
F15411189: D10571.diff
Wed, Mar 19, 8:53 AM
F15410984: D10571.diff
Wed, Mar 19, 8:45 AM
F15410911: D10571.diff
Wed, Mar 19, 8:42 AM
F15410251: D10571.diff
Wed, Mar 19, 6:56 AM
F15403651: D10571.diff
Tue, Mar 18, 4:19 AM
F15387487: D10571.id25394.diff
Sat, Mar 15, 2:28 AM
Subscribers

Details

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.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Extend `LINT_BRACE_FORMATTING` to warn on missing braces.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.

This should maybe be a separate linter rule.

epriestley edited edge metadata.
This revision is now accepted and ready to land.Oct 3 2014, 11:04 AM
This revision was automatically updated to reflect the committed changes.