Skip to content

Commit

Permalink
Remove Lager as a direct dependency
Browse files Browse the repository at this point in the history
Change the sole call to `lager:info` into `elvis_utils:info`

This is the elvis_core parallel to inaka/elvis#411
  • Loading branch information
waisbrot committed Oct 25, 2016
1 parent ad16894 commit 80cf8c9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
6 changes: 2 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
%% == Erlang Compiler ==

%% Erlang compiler options
{erl_opts, [ {parse_transform, lager_transform}
, warn_unused_vars
{erl_opts, [ warn_unused_vars
, warn_export_all
, warn_shadow_vars
, warn_unused_import
Expand Down Expand Up @@ -66,8 +65,7 @@

%% == Dependencies ==

{deps, [ {lager, "3.0.2"}
, {zipper, "1.0.1"}
{deps, [ {zipper, "1.0.1"}
, {katana_code, "0.1.0"}
]}.

Expand Down
8 changes: 3 additions & 5 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.7">>},1},
{<<"katana_code">>,{pkg,<<"katana_code">>,<<"0.1.0">>},0},
{<<"lager">>,{pkg,<<"lager">>,<<"3.0.2">>},0},
{<<"zipper">>,
{git,"https://github.com/inaka/zipper.git",
{ref,"47358be662a6749b5b0b932fc0aaad405f537a1c"}},
0}]}.
{<<"zipper">>,{pkg,<<"zipper">>,<<"1.0.1">>},0}]}.
[
{pkg_hash,[
{<<"aleppo">>, <<"8DB14CF16BB8C263C14FF4C3F69F64D7C849D40888944F4204D2CA74F1114CEB">>},
{<<"goldrush">>, <<"349A351D17C71C2FDAA18A6C2697562ABE136FEC945F147B381F0CF313160228">>},
{<<"katana_code">>, <<"C34F3926A258D6BEACD8D21F140F3D47D175501936431C460B144339D5271A0B">>},
{<<"lager">>, <<"25DC81BC3659B62F5AB9BD073E97DDD894FC4C242019FCCEF96F3889D7366C97">>}]}
{<<"lager">>, <<"25DC81BC3659B62F5AB9BD073E97DDD894FC4C242019FCCEF96F3889D7366C97">>},
{<<"zipper">>, <<"3CCB4F14B97C06B2749B93D8B6C204A1ECB6FAFC6050CACC3B93B9870C05952A">>}]}
].
2 changes: 1 addition & 1 deletion src/elvis.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{pkg_name, elvis_core},
{description, "Core library for the Erlang style reviewer"},
{vsn, "0.3.2"},
{applications, [kernel, stdlib, lager, zipper, katana_code]},
{applications, [kernel, stdlib, zipper, katana_code]},
{modules,
[
elvis_core,
Expand Down
2 changes: 1 addition & 1 deletion src/elvis_code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ print_node(Node = #{type := Type}, CurrentLevel) ->
Indentation = lists:duplicate(CurrentLevel * 4, $ ),
Content = ktn_code:content(Node),

ok = lager:info("~s - [~p] ~p~n", [Indentation, CurrentLevel, Type]),
ok = elvis_utils:info("~s - [~p] ~p~n", [Indentation, CurrentLevel, Type]),
_ = lists:map(fun(Child) -> print_node(Child, CurrentLevel + 1) end,
Content),
ok.
Expand Down
1 change: 1 addition & 0 deletions src/elvis_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ error_prn(Message, Args) ->
ColoredMessage = "{{red}}Error: {{reset}}" ++ Message ++ "{{reset}}~n",
print(ColoredMessage, Args).

-spec print(string(), [term()]) -> ok.
print(Message, Args) ->
case application:get_env(elvis, no_output) of
{ok, true} -> ok;
Expand Down

0 comments on commit 80cf8c9

Please sign in to comment.