Skip to content

Commit 2b0fc52

Browse files
author
José Valim
committed
Improve error messages for :only conflict
Signed-off-by: José Valim <[email protected]>
1 parent aaa775a commit 2b0fc52

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/mix/lib/mix/dep.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,16 @@ defmodule Mix.Dep do
225225
def format_status(%Mix.Dep{app: app, status: {:divergedonly, other}} = dep) do
226226
recommendation =
227227
if Keyword.has_key?(other.opts, :only) do
228-
"Ensure the parent dependency specifies a superset of the child one in"
228+
"Ensure you specify at least the same environments in :only in your dep"
229229
else
230-
"Remove the :only restriction from"
230+
"Remove the :only restriction from your dep"
231231
end
232232

233-
"the dependency #{app}\n" <>
233+
"the :only option for dependency #{app}\n" <>
234234
"#{dep_status(dep)}" <>
235-
"\n does not match the environments calculated for\n" <>
235+
"\n does not match the :only option calculated for\n" <>
236236
"#{dep_status(other)}" <>
237-
"\n #{recommendation} your dep"
237+
"\n #{recommendation}"
238238
end
239239

240240
def format_status(%Mix.Dep{app: app, status: {:diverged, other}} = dep) do

lib/mix/test/mix/dep_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ defmodule Mix.DepTest do
496496
Mix.Tasks.Deps.run([])
497497
assert_received {:mix_shell, :info, ["* git_repo" <> _]}
498498
assert_received {:mix_shell, :info, [msg]}
499-
assert msg =~ "Ensure the parent dependency specifies a superset of the child one"
499+
assert msg =~ "Ensure you specify at least the same environments in :only in your dep"
500500
end
501501
end
502502
end

0 commit comments

Comments
 (0)