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

Pierre Fenoll pierrefenoll@REDACTED
Sun Aug 28 14:53:56 CEST 2016


Ah so I tried erl_tidy and like Tristan says over at
https://github.com/tsloughter/erl_tidy :
Oh boy my specs!

erlang-mode does not rewrite code in the same sense as erl_tidy.
Instead it behaves as if one was pressing the TAB key on each line of a
file, thus only changing space to the left of the current line.

Even though I like erl_tidy's "unclobbering or commas" (it turns A,B,C into
A, B, C)
I very much prefer erlang-mode's "preservation of \ns": it only changes the
indentation characters.

How do you handle the cases where erl_tidy spews out AST code instead of
compilable code?


@Max 4 spaces, although that is configurable somewhere.
This feature needs confirmation though: that's 4. in
https://github.com/fenollp/erlang-formatter#to-do



Cheers,
-- 
Pierre Fenoll


On 28 August 2016 at 14:06, Mark Bucciarelli <mkbucc@REDACTED> wrote:

> Hi,
>
> I had the same itch!
>
>     * http://erlang.org/pipermail/erlang-questions/2016-April/088975.html
>
>     * https://github.com/mbucc/erlfmt (which grew out of that thread)
>
> I use it whenever I am coding with Erlang (and it also helped expose an
> erl_tidy bug [1] :).
>
> Thanks,
>
> Mark
>
> [1] https://github.com/erlang/otp/commit/0969ecad9e2978bacb7b27f663cd16
> aa5ea6c460
>
> On Sun, Aug 28, 2016 at 6:01 AM, Pierre Fenoll <pierrefenoll@REDACTED>
> wrote:
>
>> We had too many discussions about style on a lengthy open source Erlang
>> project (2600Hz's Kazoo).
>>
>> We have now as part of our CI checks a style-ensuring tool that formats
>> .erl .hrl .app.src .escript
>> in the "standard format" of Emacs' erlang-mode.
>>
>> https://github.com/fenollp/erlang-formatter is now in version 1.
>> We use it daily which helps us redirect our shouting at CircleCI instead
>> of colleagues.
>>
>> And shouting is certainly great to redirect
>> http://erlang.org/pipermail/erlang-questions/2014-February/076908.html
>>
>> This implementation uses emacs > 23 under the hood.
>> * It was the fastest & shortest way to implement
>> * erlang-mode is the closest thing to a standard there is for formatting
>> Some other tools / implementations are listed in the project's README.
>>
>> So far this project helped uncover 4 bugs in erlang-mode which I minified
>> & reported.
>>
>> I share this in hope that this can help people & tame some shouting.
>> A non-Emacs implementation would be amazing (probably faster, more
>> portable).
>> With your help this project can turn into a test bed for such an
>> adventure!
>>
>> A rebar3 fmt plugin is in the works.
>>
>> Please tell me what you think but I don't care about your religious
>> beliefs :)
>>
>> Cheers,
>> --
>> Pierre Fenoll
>>
>>
>> _______________________________________________
>> 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/20160828/12ca793f/attachment.htm>


More information about the erlang-questions mailing list