[erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang)

Mark Bucciarelli mkbucc@REDACTED
Wed Aug 31 12:32:09 CEST 2016


[resending, this time to the list as well]

On Tue, Aug 30, 2016 at 6:56 AM, Pierre Fenoll <pierrefenoll@REDACTED>
 wrote:

> erl_tidy or erl_prettypr:format is missing a lot of options. For example:
>
> A long spec might get broken down into multiple lines (and that's fine).
> However I find it surprising (and hard to grep) that newlines are inserted
> right after the -spec attribute.
>
>
I think producing formatted output that matches with what people are likely
to grep for is very important.

The commit says getting the "new abstract tree nodes and their associated
functions" right was the main priority and that contributions that fix
formatting "are very welcome".  In my limited experience (one PR), the
Erlang team is very responsive to patches.


>
> Later on we could agree on which options we want to have as standard.
>
>
BTW, I found an informative slide show [1] on the history of gofmt.  This
slide describes how gofmt became the standard:https://talks.golang.org/2015/
gofmt-en.slide#26

Some other bullets from the slideshow that I found interesting:

    * No knobs!

    * Missing insight: "good enough" uniform formatting style is better
than having lots of different formats.

    * Value of style guide: Uniformity, not perfection.

    * Don't fret over line length control.

    * Instead, respect user: Consider line breaks in original source.

    * Single biggest mistake: comments not attached to AST nodes.
Mark

[1] https://talks.golang.org/2015/gofmt-en.slide#1

On Tue, Aug 30, 2016 at 6:56 AM, Pierre Fenoll <pierrefenoll@REDACTED>
wrote:

> > "indentation only" or "full rewrite"
>
> erl_tidy or erl_prettypr:format is missing a lot of options. For example:
>
> A long spec might get broken down into multiple lines (and that's fine).
> However I find it surprising (and hard to grep) that newlines are inserted
> right after the -spec attribute.
>
> Options to toggle such behavior are I think needed in erl_tidy.
>
> Later on we could agree on which options we want to have as standard.
>
> > On 30 Aug 2016, at 09:54, Vlad Dumitrescu <vladdu55@REDACTED> wrote:
> >
> > "indentation only" or "full rewrite"
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Blogging at markbucciarelli.com
Tweeting @mbucc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160831/2898c0e1/attachment.htm>


More information about the erlang-questions mailing list