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
F14023617: D10571.diff
Thu, Nov 7, 3:12 AM
F13998361: D10571.diff
Thu, Oct 24, 9:05 AM
F13993644: D10571.diff
Wed, Oct 23, 12:20 AM
F13967585: D10571.id26279.diff
Wed, Oct 16, 2:37 PM
Unknown Object (File)
Oct 10 2024, 10:05 AM
Unknown Object (File)
Oct 1 2024, 5:11 AM
Unknown Object (File)
Sep 27 2024, 6:08 AM
Unknown Object (File)
Aug 30 2024, 1:33 PM
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.