Commit graph

17 commits

Author SHA1 Message Date
Amit Kapoor
0191806f92 Add support for custom xref queries
The custom queries are configured in rebar.config via the tuple
{xref_queries, [{query(), query_result()},...]}.  The implementation
passes the query() string to xref:q and compares the return value with
query_result(). It will result in an error if they do not match.

The following configuration, for example, is the same as running the
xref check undefined_function_calls. It additionally filters
ejabberd_logger:*_msg/4 from the result as these functions are generated
on execution by ejabberd and not available at compile time.

{xref_queries, [{"(XC - UC) || (XU - X - B -
                 (\"ejabberd_logger\":\".*_msg\"/\"4\"))",[]}]}.

This patch also modifies the build process of this package by running a
custom query instead of doing a diff against a static xref_warning file.
2012-04-02 19:14:37 +02:00
Tuncer Ayaz
8c89a388bf Universally support apps=/skip_apps= 2011-12-12 21:20:34 +01:00
Tuncer Ayaz
a5e39c2c54 Move is_skipped_app/0 to rebar_app_utils 2011-12-12 17:53:56 +01:00
Tuncer Ayaz
e33d3a568f rebar_xref: move code to proper place 2011-12-12 17:09:03 +01:00
Torbjorn Tornkvist
b4f136d752 Make 'rebar xref' honour the skip_app directive
It is now possible to call rebar as:

  rebar xref skip_app=Mod1,Mod2,...

This makes it easy to skip running xref on (e.g)
imported dependencies in your application.

The function rebar_utils:is_skipped_app/0 is added so
that other rebar commands may use it.
2011-12-12 17:06:23 +01:00
Fabian Linzberger
176ec0e71e Work around functions not found in source
For parameterized modules, the beam code will have a compiler
generated new/1 and instance/1 function.

If while checking the beam, xref detects one of those is unused, the
rebars xref wrapper will try to find the location of the definition of
that function in the source code for the module (to give a more
specific warning to the user). Since the function was generated by the
compiler it does not actually exist in the source, and rebar crashes
at that stage. This patch works around that issue.
2011-10-20 16:37:41 +02:00
Shunichi Shinohara
862ae1f192 Abort if xref emits warnings 2011-05-25 20:28:32 +02:00
Jordi Chacon
e684af36f0 Fix bug: xref should be stopped after being run
Xref not being stopped caused a crash in subsequent xref runs.
2011-03-26 12:25:25 +01:00
Tuncer Ayaz
63de05d914 Clean up code 2011-02-06 17:41:04 +01:00
Tuncer Ayaz
c466076ffb Clean up emacs file local variables 2011-01-31 17:55:36 +01:00
Tuncer Ayaz
150c9d0b47 Simplify and cleanup rebar_xref 2011-01-13 17:39:14 +01:00
Tuncer Ayaz
d922985b36 Fix typos 2011-01-13 17:39:14 +01:00
Tuncer Ayaz
c2917b31d4 Fix issues found by dialyzer 2010-10-10 23:24:20 +02:00
Kostis Sagonas
e024778599 Dialyzer related cleanups 2010-10-10 14:11:13 -06:00
Klas Johansson
aea3184139 Fix compiler warnings 2010-06-19 15:46:57 +02:00
Dave Smith
0add7acdbf Make sure to add ebin/ to the code path as well so that xref can properly determine source/line of code. 2010-04-23 09:27:50 -06:00
Dave Smith
fcf4507a80 Add stub for xref support; not yet done 2010-04-09 09:25:00 -06:00