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

Bengt Kleberg bengt.kleberg@REDACTED
Tue Aug 30 11:08:03 CEST 2016


If erlfmt gave me a single, consistent, format to un-format to my 
liking, for my own private viewing, it would be good enough for me.

These, purely private, sources would be erlfmt'ed before I release them 
to other viewers.

gofmt is not configurable. On purpose.


On 08/30/2016 09:54 AM, Vlad Dumitrescu wrote:
> Hi,
>
> Sourcer would have some advantages, yes, but it's still in very early 
> stages. The goal is to have an AST as compatible as possible with the 
> standard one, so for the time being it is less important which parser 
> is used. For formatting syntactical correct files there should be no 
> difference.
>
> My take on this is that the first step is to define what the right way 
> to format code is, in form of a specification or a test suite to be 
> passed by the formatter. A big part of this is to decide if formatting 
> should be "indentation only" or "full rewrite" or both - there are 
> arguments to be made for each variant. Another one is about how to 
> indent (tabs, spaces, how many) and how wide the page is (80 
> characters may feel too narrow for today's monitors, but sometimes 
> code has to be read/edited on narrow terminals). Different use cases 
> need different configuration, I'm not sure if it's possible to have 
> one solution to please everybody.
>
> best regards,
> Vlad
>
>
> On Mon, Aug 29, 2016 at 11:41 PM, Tuncer Ayaz <tuncer.ayaz@REDACTED 
> <mailto:tuncer.ayaz@REDACTED>> wrote:
>
>     Thanks for sharing the project. My thoughts follow.
>
>     vim-erlang-runtime[0] output is very close to erlang.el, and it
>     doesn't suffer from some of the parsing erros of current erlang.el (as
>     reported on bugs.erlang.org <http://bugs.erlang.org>). vim might
>     be more readily available in
>     your CI env, if you want to automatically check for style regressions.
>
>     Also, Bengt's bepp[1][2] looks useful.
>
>     However, I think Vlad's sourcer might be the best base for an escript
>     and plugin, especially because it aims to be forgiving with, say,
>     unfinished code. This is very important for use in editors.
>
>     [0] https://github.com/vim-erlang/vim-erlang-runtime
>     <https://github.com/vim-erlang/vim-erlang-runtime>
>
>     [1] https://github.com/ebengt/erlang_stdin_formatter
>     <https://github.com/ebengt/erlang_stdin_formatter>
>     [2] https://github.com/ebengt/erlang_string_io
>     <https://github.com/ebengt/erlang_string_io>
>
>     [3] https://github.com/erlang/sourcer
>     <https://github.com/erlang/sourcer>
>     _______________________________________________
>     erlang-questions mailing list
>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>     http://erlang.org/mailman/listinfo/erlang-questions
>     <http://erlang.org/mailman/listinfo/erlang-questions>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160830/82ff1506/attachment.htm>


More information about the erlang-questions mailing list