[erlang-questions] erlfmt?

Bengt Kleberg bengt.kleberg@REDACTED
Tue May 31 16:34:53 CEST 2016


There is a new version of the string_io module that handles the new 
io_request format (a unicode atom was added sometime).
With this I think bepp (the formatter) now works.

Note: to use bepp with '<', call stdin/0.


bengt

On 05/24/2016 09:35 PM, Mark Bucciarelli wrote:
> Hi,
>
> I didn't look at that as I didn't find it before.
>
> I tried it, but only got comments out.  Maybe I'm not using it right?
>
> ~/src/erlang_stdin_formatter/src$ cat erlfmt
>
> #!/usr/bin/env escript
>
> main([]) ->
>
> bepp:main([prog]).
>
> ~/src/erlang_stdin_formatter/src$ ./erlfmt < a_program.erl
>
>
> Thanks,
>
>
> Mark
>
>
> On Mon, May 23, 2016 at 1:24 AM, Bengt Kleberg 
> <bengt.kleberg@REDACTED <mailto:bengt.kleberg@REDACTED>> wrote:
>
>     Greetings,
>
>     If you looked at https://github.com/ebengt/erlang_stdin_formatter
>     I would be interested in suggestions as to where it was not
>     sufficient.
>
>
>     Bengt
>
>
>     On 05/23/2016 03:11 AM, Mark Bucciarelli wrote:
>>     Thanks for the suggestions!
>>
>>     I took a look at each, but none of the three options really gave
>>     me what I wanted. So I ended up wrapping erl_tidy in a way that
>>     gives me what I want:
>>
>>     :%!erlfmt
>>
>>     Here's the source, such as it is: https://github.com/mbucc/erlfmt.
>>
>>     It was able to format 1,794 out of 1,795 source files under
>>     /usr/local/Cellar/erlang/18.2.1. <http://18.2.1.>  It failed to
>>     format lib/erlang/lib/wx-1.6/src/gen/gl.erl, which is 971KB in size.
>>
>>     Mark
>>
>>     On Thu, Apr 28, 2016 at 3:09 AM, Roger Lipscombe
>>     <roger@REDACTED <mailto:roger@REDACTED>> wrote:
>>
>>         I use vimerl (https://github.com/jimenezrick/vimerl), which
>>         has an
>>         escript included:
>>         https://github.com/jimenezrick/vimerl/blob/master/indent/erlang_indent.erl
>>
>>         I *believe* that it's equivalent to Emacs erlang-mode, but I
>>         don't
>>         have Emacs installed :-P
>>
>>         On 28 April 2016 at 07:24, Pierre Fenoll
>>         <pierrefenoll@REDACTED <mailto:pierrefenoll@REDACTED>> wrote:
>>         > I made https://github.com/fenollp/erlang-formatter though
>>         it depends on
>>         > OTP's Emacs erlang-mode.
>>         >
>>         > erlang-mode has been the de facto authority in terms of
>>         linting.
>>         > However it has some issues, like when indenting typed
>>         record definitions.
>>         >
>>         > Dropping the dependency on Emacs would be great but again,
>>         which dev/CI
>>         > machine doesn't have Emacs?
>>         >
>>         > On 28 Apr 2016, at 00:46, Tristan Sloughter
>>         <t@REDACTED <mailto:t@REDACTED>> wrote:
>>         >
>>         > Short answer: No.
>>         >
>>         > Long answer: No, but I'd love for someone with the time to
>>         clean up
>>         > https://github.com/tsloughter/erl_tidy which is a rebar3
>>         plugin named `fmt`
>>         > around erl_tidy. the erl_tidy code has issues with type
>>         specs and other
>>         > newer syntax and will currently just dump out the AST for
>>         those. These fixes
>>         > would then, of course, need to be submitted upstream to
>>         OTP, but this plugin
>>         > provides a testing ground and hopefully motivation to
>>         someone out there :)
>>         >
>>         > --
>>         > Tristan Sloughter
>>         > t@REDACTED <mailto:t@REDACTED>
>>         >
>>         >
>>         >
>>         > On Wed, Apr 27, 2016, at 05:37 PM, Mark Bucciarelli wrote:
>>         >
>>         > Hi,
>>         >
>>         > I'm wondering if anyone here uses or knows of a utility
>>         like gofmt for
>>         > Erlang.  If you're not familiar with gofmt, it simply reads
>>         source code on
>>         > stdin and writes formatted source code to stdout.
>>         >
>>         > I looked at erl_tidy but cannot see how to make it read stdin.
>>         >
>>         > Thanks,
>>         >
>>         > Mark
>>         > _______________________________________________
>>         > erlang-questions mailing list
>>         > erlang-questions@REDACTED
>>         <mailto:erlang-questions@REDACTED>
>>         > http://erlang.org/mailman/listinfo/erlang-questions
>>         >
>>         >
>>         >
>>         > _______________________________________________
>>         > erlang-questions mailing list
>>         > erlang-questions@REDACTED
>>         <mailto:erlang-questions@REDACTED>
>>         > http://erlang.org/mailman/listinfo/erlang-questions
>>         >
>>         >
>>         > _______________________________________________
>>         > erlang-questions mailing list
>>         > erlang-questions@REDACTED
>>         <mailto:erlang-questions@REDACTED>
>>         > http://erlang.org/mailman/listinfo/erlang-questions
>>         >
>>         _______________________________________________
>>         erlang-questions mailing list
>>         erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>>         http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>>
>>     _______________________________________________
>>     erlang-questions mailing list
>>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>>     http://erlang.org/mailman/listinfo/erlang-questions
>
>
>     _______________________________________________
>     erlang-questions mailing list
>     erlang-questions@REDACTED <mailto: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/20160531/bea8e811/attachment.htm>


More information about the erlang-questions mailing list