Skip to content

Commit

Permalink
Warn on cyclic modules dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zinid committed Jul 7, 2016
1 parent 12c0d88 commit c718cbb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gen_mod.erl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ sort_modules(Host, ModOpts) ->
[DepMod, Mod]);
{DepMod, DepOpts} ->
digraph:add_vertex(G, DepMod, DepOpts),
digraph:add_edge(G, DepMod, Mod)
case digraph:add_edge(G, DepMod, Mod) of
{error, {bad_edge, Path}} ->
?WARNING_MSG("cyclic dependency detected "
"between modules: ~p",
[Path]);
_ ->
ok
end
end
end, Deps)
end, ModOpts),
Expand Down

0 comments on commit c718cbb

Please sign in to comment.