[erlang-questions] erlfmt?

Mark Bucciarelli mkbucc@REDACTED
Tue May 24 21:35:54 CEST 2016


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>
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>
> 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.  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>
> 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>
>> 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>
>> 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
>> >
>> >
>> >
>> > 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
>> > 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
>> >
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
>
>
> _______________________________________________
> erlang-questions mailing listerlang-questions@REDACTED://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/20160524/915ea533/attachment.htm>


More information about the erlang-questions mailing list