<div dir="ltr"><div>I'm trying to use erl_lint() to build a simple Erlang syntax and style checker. I've gotten far enough to load the file and parse it into Forms and to get erl_lint to partially understand it, but then erl_lint complains about undefined functions that are defined. What am I doing wrong?<br><br>erlint.erl :</div><div><br></div><div>    -module(erlint).</div><div>    -export([lint/1]).</div><div><br></div><div>    % based on <a href="http://stackoverflow.com/a/28086396/13675">http://stackoverflow.com/a/28086396/13675</a></div><div><br></div><div>    lint(File) -> </div><div>        {ok, B} = file:read_file(File),</div><div>        Forms = scan(erl_scan:tokens([],binary_to_list(B),1),[]),</div><div>        F = fun(X) -> {ok,Y} = erl_parse:parse_form(X), Y end,</div><div>        erl_lint:module([F(X) || X <- Forms],File).</div><div><br></div><div>    scan({done,{ok,T,N},S},Res) -></div><div>        scan(erl_scan:tokens([],S,N),[T|Res]);</div><div>    scan(_,Res) -></div><div>        lists:reverse(Res).</div><div><br></div><div>hello.erl :</div><div><br></div><div>    -module(hello).</div><div>    -export([hello_world/0]).</div><div><br></div><div>    hello_world() -> io:fwrite("hello, world\n").</div><div><br></div><div>attempt to use :</div><div><br></div><div>    1> c(erlint).</div><div>    {ok,erlint}</div><div>    2> erlint:lint("hello.erl").</div><div>    {error,[{"hello.erl",</div><div>             [{2,erl_lint,{undefined_function,{hello_world,0}}}]}],</div><div>           []}</div><div><br></div><div>PS: This is a cross post after posting on reddit and stackoverflow.</div></div>