AdRoll / rebar3_format

Erlang Formatter for Rebar3
https://tech.nextroll.com/blog/dev/2020/02/25/erlang-rebar3-format.html
MIT License
109 stars 21 forks source link

Keep beginning braces in one line #306

Open vkatsuba opened 2 years ago

vkatsuba commented 2 years ago

Currently, formatter add new like and try keep braces at the same like with items, fields: Record

-record(z_msg_v1,
        {qos = 0 :: 0 | 1 | 2,
         dup = false :: boolean()
}

Maps

-define(xxx,
        #{
            a => 1
            b => 2
        }).

I would like it to be formatted like: Record

-record(z_msg_v1, {
        qos = 0 :: 0 | 1 | 2,
        dup = false :: boolean()
}

Maps

-define(xxx, #{
        a => 1
        b => 2
 }).

I suppose it would be great to add additional rule like: keep_braces_at_line => true or similar.

Regards, --V