Bläddra i källkod

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 år sedan
förälder
incheckning
a0bbb69254
1 ändrade filer med 7 tillägg och 4 borttagningar
  1. +7
    -4
      src/rebar_prv_xref.erl

+ 7
- 4
src/rebar_prv_xref.erl Visa fil

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

Laddar…
Avbryt
Spara