[erlang-questions] erl_tidy and specs

Fredrik Andersson sedrik@REDACTED
Sat Feb 8 10:47:55 CET 2014


Ok, sounds like a great area to improve on then. having an official
formatter would solve many issues we have today. =)


On Sat, Feb 8, 2014 at 2:09 AM, Anthony Ramine <n.oxyde@REDACTED> wrote:

> Hello,
>
> No syntax tools code yet, but I've made some documentation about the
> various trees that need to be handled.
>
>         https://github.com/erlang/otp/pull/230
>
> Regards,
>
> --
> Anthony Ramine
>
> Le 7 févr. 2014 à 17:01, Gleb Peregud <gleber.p@REDACTED> a écrit :
>
> > The fact that Go team created and popularized "go fmt" from the
> > very-very beginning was an awesome move! I would really like to be
> > able to read the code which is always sanely and consistently
> > formatted. If someone had time to improve erl_tidy and OTP team would
> > promote it more, I would so very happy.
> >
> > On Fri, Feb 7, 2014 at 4:33 PM, Anthony Ramine <n.oxyde@REDACTED>
> wrote:
> >> Yeah it is expected. Syntax_tools pretty-printing of Dialyzer-related
> attributes could be improved, but it requires a lot of new functions, as
> they are currently dumbed down to tuples.
> >>
> >> --
> >> Anthony Ramine
> >>
> >> Le 7 févr. 2014 à 14:53, Fredrik Andersson <sedrik@REDACTED> a écrit
> :
> >>
> >>> Hi all
> >>>
> >>> In light of the recent indentation flamewar I thought about looking
> for something that could become our version of go fmt and stumbled across
> erl_tidy (http://erlang.org/doc/man/erl_tidy.html).
> >>>
> >>> Now it looks good but seems to be old as it does not handle specs
> correctly.
> >>>
> >>> Given the following file.
> >>> -module(spec_error).
> >>>
> >>> -export([spec_error_fun/0]).
> >>>
> >>> -spec spec_error_fun() -> ok.
> >>> spec_error_fun() ->
> >>>    ok.
> >>>
> >>> after calling erl_tidy:dir() in the directory where it resides I get
> the following.
> >>>
> >>> -module(spec_error).
> >>>
> >>> -export([spec_error_fun/0]).
> >>>
> >>> -spec({{spec_error_fun, 0},
> >>>       [{type, 5, 'fun',
> >>>         [{type, 5, product, []}, {atom, 5, ok}]}]}).
> >>>
> >>> spec_error_fun() -> ok.
> >>>
> >>> Is this expected or is it a bug?
> >>> _______________________________________________
> >>> erlang-questions mailing list
> >>> erlang-questions@REDACTED
> >>> http://erlang.org/mailman/listinfo/erlang-questions
> >>
> >> _______________________________________________
> >> erlang-questions mailing list
> >> erlang-questions@REDACTED
> >> 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/20140208/b2197489/attachment.htm>


More information about the erlang-questions mailing list