<div>I have this code:</div><div><br></div><div><font face="courier new, monospace">%%%%%%%%%%%%%%%%%%%%%%%%</font></div><div><div><font face="courier new, monospace">-module(mymodule).</font></div><div><font face="courier new, monospace">-export([hello/0, goodbye/0, greetings/1]).</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-spec hello() -> string().</font></div><div><font face="courier new, monospace">hello() -></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>greetings("hello").</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-spec goodbye() -> string().</font></div><div><font face="courier new, monospace">goodbye() -></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>greetings("goodbye").</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-spec greetings(Text::string()) -> string().</font></div><div><font face="courier new, monospace">greetings(Text) -></font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>lists:flatten(io_lib:format("~s sublimerl", [Text])).</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">-ifdef(TEST).</font></div><div><font face="courier new, monospace">-include_lib("eunit/include/eunit.hrl").</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">simple_test() -></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>?assertEqual("hey sublimerl", greetings("hey")).</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">greetings_test_() -></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>[?_assertEqual("hey sublimerl", greetings("hey"))].</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-endif.</font></div></div><div><font face="courier new, monospace">%%%%%%%%%%%%%%%%%%%%%%%%</font></div><div><br></div><div>
<br></div><div>when i convert it using this:</div><div><br></div><div><br></div><div><div><font face="courier new, monospace">%%%%%%%%%%%%%%%%%%%%%%%%</font></div></div><div><font face="courier new, monospace">Formatted = case epp_dodger:parse_file(FilePath) of</font></div>
<div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>{ok, Forms} -></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>case lists:keymember(error, 1, Forms) of</font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>false -></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>erl_prettypr:format(erl_recomment:recomment_forms(Forms, erl_comment_scan:file(FilePath)));</font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>true -></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>""</font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>end;</font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>{error, _} -></font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>""</font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>end</font></div>
</div><div><div><font face="courier new, monospace">%%%%%%%%%%%%%%%%%%%%%%%%</font></div></div><div><br></div><div><br></div><div>I get:</div><div><br></div><div><div><font face="courier new, monospace">%%%%%%%%%%%%%%%%%%%%%%%%</font></div>
</div><div><font face="courier new, monospace">-module(mymodule).</font></div><div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-export([hello/0, goodbye/0, greetings/1]).</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-spec({{hello, 0},</font></div><div><font face="courier new, monospace"> [{type, 4, 'fun',</font></div><div>
<font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span> [{type, 4, product, []}, {type, 4, string, []}]}]}).</font></div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace">hello() -> greetings("hello").</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-spec({{goodbye, 0},</font></div>
<div><font face="courier new, monospace"> [{type, 8, 'fun',</font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span> [{type, 8, product, []}, {type, 8, string, []}]}]}).</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">goodbye() -> greetings("goodbye").</font></div><div><font face="courier new, monospace"><br></font></div><div>
<font face="courier new, monospace">-spec({{greetings, 1},</font></div><div><font face="courier new, monospace"> [{type, 12, 'fun',</font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span> [{type, 12, product,</font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span> [{ann_type, 12,</font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span> [{var, 12, 'Text'}, {type, 12, string, []}]}]},</font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span> {type, 12, string, []}]}]}).</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">greetings(Text) -></font></div>
<div><font face="courier new, monospace"> lists:flatten(io_lib:format("~s sublimerl", [Text])).</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-ifdef(TEST).</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-include_lib("eunit/include/eunit.hrl").</font></div><div><font face="courier new, monospace"><br></font></div><div>
<font face="courier new, monospace">simple_test() -></font></div><div><font face="courier new, monospace"> ?assertEqual("hey sublimerl", (greetings("hey"))).</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">greetings_test_() -></font></div><div><font face="courier new, monospace"> [?_assertEqual("hey sublimerl", (greetings("hey")))].</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">-endif.</font></div></div><div><div><font face="courier new, monospace">%%%%%%%%%%%%%%%%%%%%%%%%</font></div></div><div><br>
</div><div><br></div><div>What happens to spec? What is the best way to use an erlang auto-formatter?</div><div><br></div><div>Any input welcome.</div><div><br></div><div>r.</div><div><br></div>