From 0191806f9282c6ce1da0f1a2c0672406de15ed24 Mon Sep 17 00:00:00 2001 From: Amit Kapoor Date: Mon, 2 Apr 2012 08:01:39 -0700 Subject: 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. --- Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e521f08..a5cdf74 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,8 @@ debug: check: debug xref dialyzer -xref: xref_warnings - @diff -U0 xref_reference xref_warnings - -xref_warnings: - -@./rebar xref > xref_warnings +xref: + -@./rebar xref dialyzer: dialyzer_warnings @diff -U0 dialyzer_reference dialyzer_warnings -- cgit v1.1