Join property declarations with attributes on one line when possible
commit86a86682a189f50b583c55af936faed0e9c39b51
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Tue, 25 Sep 2018 01:00:25 +0000 (24 18:00 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 25 Sep 2018 01:15:03 +0000 (24 18:15 -0700)
tree282940915f972581195b0aa75aea621fffdd28c4
parent850a35bf4d309c9e8eaac16dbf1a2792046a050a
Join property declarations with attributes on one line when possible

Summary:
The introduction of the `__LateInit` attribute has raised concerns about the formatting of property declarations. Since hackfmt currently always breaks after attribute lists, adding an attribute to each property declaration in a group of several property declarations which previously had none makes the group much sparser and harder to read.

This change joins the declaration with the attribute list when it fits.

Reviewed By: pittsw

Differential Revision: D10014673

fbshipit-source-id: 4a7e0677e9a152e2ab59a297d2d09fb55f2a401b
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/test/hackfmt/tests/lateinit_property.php [new file with mode: 0644]
hphp/hack/test/hackfmt/tests/lateinit_property.php.exp [new file with mode: 0644]