Allow single-line class and function bodies
commit7508d321c7036016b8d4c51329336355457e511f
authorJake Bailey <jakebailey@fb.com>
Tue, 12 Sep 2017 19:48:54 +0000 (12 12:48 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 12 Sep 2017 19:59:57 +0000 (12 12:59 -0700)
tree7ba4f097c23e053a7fb1c162cc10b683b99d23e1
parente1da549c596d02af3d405291e716ac59c55b34fa
Allow single-line class and function bodies

Summary: This change preserves class bodies and function bodies which are collapsed onto a single line. It does not collapse braces onto a single line when they were not already formatted that way.

Reviewed By: arxanas

Differential Revision: D5810606

fbshipit-source-id: 1b451040b71d29d8890cb59aa741717ee7b6fa98
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/test/hackfmt/tests/anonymous_function_args.php.exp
hphp/hack/test/hackfmt/tests/async_coroutine_function1.php.exp
hphp/hack/test/hackfmt/tests/coroutine_function1.php.exp
hphp/hack/test/hackfmt/tests/empty_braces.php [new file with mode: 0644]
hphp/hack/test/hackfmt/tests/empty_braces.php.exp [new file with mode: 0644]
hphp/hack/test/hackfmt/tests/shape_structural_subtyping_with_optional_and_non_optional_types.php.exp
hphp/hack/test/hackfmt/tests/shape_structural_subtyping_with_optional_type.php.exp
hphp/hack/test/hackfmt/tests/shape_structural_subtyping_with_optional_type_and_extra_types.php.exp