diff options
author | Bryan Paxton <starbelly@pobox.com> | 2018-11-30 20:06:42 -0600 |
---|---|---|
committer | Bryan Paxton <starbelly@pobox.com> | 2018-12-02 13:55:36 -0600 |
commit | 4deb6437f548a803509bce1ee87850c5501edc03 (patch) | |
tree | c771b09d9f5a6ea44972e3ed93fac98e17c7439b /src | |
parent | 73bf5b4c055ef30089dabb3f99d09410af144b7f (diff) |
Support ignoring whole modules in xref results
- Added support to rebar_prv_xref for filtering out whole module. A
module may now be added to the list of xref_ignores in rebar.config or
via -ignore_xref() module attribute
- Added unit test for whole module filtering support to xref CT suite
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_xref.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rebar_prv_xref.erl b/src/rebar_prv_xref.erl index 12063d5..3c987b4 100644 --- a/src/rebar_prv_xref.erl +++ b/src/rebar_prv_xref.erl @@ -160,7 +160,8 @@ get_xref_ignorelist(Mod, XrefCheck) -> %% And create a flat {M,F,A} list lists:foldl( fun({F, A}, Acc) -> [{Mod,F,A} | Acc]; - ({M, F, A}, Acc) -> [{M,F,A} | Acc] + ({M, F, A}, Acc) -> [{M,F,A} | Acc]; + (M, Acc) when is_atom(M) -> [M | Acc] end, [], lists:flatten([IgnoreXref, BehaviourCallbacks])). keyall(Key, List) -> @@ -195,7 +196,8 @@ filter_xref_results(XrefCheck, XrefIgnores, XrefResults) -> end, SearchModules), [Result || Result <- XrefResults, - not lists:member(parse_xref_result(Result), Ignores)]. + not lists:member(element(1, Result), Ignores) + andalso not lists:member(parse_xref_result(Result), Ignores)]. display_results(XrefResults, QueryResults) -> [lists:map(fun display_xref_results_for_type/1, XrefResults), |