[erlang-patches] Fix searching for source files in cover:analyse_to_file/*

Jeremy Raymond jeraymond@REDACTED
Sat Apr 24 15:24:11 CEST 2010


Hello,

My mistake with the exports, I'd seen it as the functions being exported
twice but really it was different spellings of the functions: analyse with
an S vs analyze with a Z. It looks like analyse with the S are the
documented functions... however I better restore it, someone must be using
the Z versions.

I'll clean up the code as per you suggestions below and post an update.

--
Jeremy Raymond


2010/4/24 Björn Gustavsson <bgustavsson@REDACTED>

> On Fri, Apr 23, 2010 at 10:56 PM, Jeremy Raymond <jeraymond@REDACTED>
> wrote:
> > I've patched cover to search for source files in the location referenced
> in
> > the .beam file instead of just in the .beam directory and in the ../src
> > relative dir. This is based upon a patch by Thomas Arts posted to
> > erlang-questions several years ago that never made it into otp (
> > http://www.erlang.org/cgi-bin/ezmlm-cgi/4/29048).
> >
> > git fetch git://github.com/jeraymond/otp.git cover_src_path_fix
>
> Thanks!
>
> Your patch removes the export of three documented functions. Why?
>
> The code itself is easy to follow and looks reasonable (and the test
> suite has been updated!), but the spacing is inconsistent both in the
> code itself and compared to the rest of the module. There should a
> space after commas in function calls, and spaces around list
> comprehension generators (" <- "), but list matching
> should be written without spaces like "[Main|_]".
>
> Also, "_" variables in the last clause of a case should be avoided
> if the value is known. So it should be:
>
> case filelib:is_file(Main) of
>    true ->
>         ...;
>    false ->
>         ...
> end.
>
> and so on for all the other "_" variables.
>
> I would also recommend that path_in_beam simply returns
> 'error' instead of an error tuple whose value is never used.
>
> --
> Björn Gustavsson, Erlang/OTP, Ericsson AB
>


More information about the erlang-patches mailing list