瀏覽代碼

xref improvements: now outputs relative file paths

Closes #2108. Changes the path to be printed to a relative path
to the current directory.

Also removes the `exports_not_used` warning from the default ones,
as Tristan suggested.
pull/2250/head
Pablo Costas 5 年之前
父節點
當前提交
a0bbb69254
共有 1 個檔案被更改,包括 7 行新增4 行删除
  1. +7
    -4
      src/rebar_prv_xref.erl

+ 7
- 4
src/rebar_prv_xref.erl 查看文件

@ -104,8 +104,7 @@ prepare(State) ->
%% Get list of xref checks we want to run
ConfXrefChecks = rebar_state:get(State, xref_checks,
[exports_not_used,
undefined_function_calls]),
[undefined_function_calls]),
XrefChecks = sets:to_list(sets:intersection(
sets:from_list(?SUPPORTED_XREFS),
@ -215,11 +214,15 @@ display_xref_result_fun(Type) ->
{Source, SMFA, TMFA} =
case XrefResult of
{MFASource, MFATarget} ->
{format_mfa_source(MFASource),
Cwd = rebar_dir:get_cwd(),
FormattedSource = format_mfa_source(MFASource),
{rebar_dir:make_relative_path(FormattedSource, Cwd),
format_mfa(MFASource),
format_mfa(MFATarget)};
MFATarget ->
{format_mfa_source(MFATarget),
Cwd = rebar_dir:get_cwd(),
FormattedTarget = format_mfa_source(MFATarget),
{rebar_dir:make_relative_path(FormattedTarget, Cwd),
format_mfa(MFATarget),
undefined}
end,

Loading…
取消
儲存