Skip to content

Commit e6e3570

Browse files
author
José Valim
committed
Improve noscm error message
1 parent db5adc1 commit e6e3570

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/mix/lib/mix/dep.ex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@ defmodule Mix.Dep do
159159
def format_status(%Mix.Dep{status: { :nomatchvsn, vsn }, requirement: req}),
160160
do: "the dependency does not match the requirement #{inspect req}, got #{inspect vsn}"
161161

162-
def format_status(%Mix.Dep{status: :noscm, from: from}),
163-
do: "the dependency defined in #{Path.relative_to_cwd(from)} did not specify a supported scm, " <>
164-
"expected one of :git, :path, :in_umbrella or " <>
165-
"the package manager Hex to be installed"
162+
def format_status(%Mix.Dep{app: app, status: :noscm, from: from}) do
163+
"the dependency #{app} in #{Path.relative_to_cwd(from)} did not specify a supported scm. " <>
164+
"Please ensure a package manager (like http://hex.pm/) is available or give one of " <>
165+
":git, :path or :in_umbrella as option"
166+
end
166167

167168
def format_status(%Mix.Dep{status: { :lockmismatch, _ }}),
168169
do: "lock mismatch: the dependency is out of date"

lib/mix/test/mix/tasks/deps_test.exs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,15 @@ defmodule Mix.Tasks.DepsTest do
122122
end
123123
end
124124

125-
test "raises when no SCM is specified" do
125+
test "warns when no SCM is specified" do
126126
Mix.Project.push NoSCMApp
127127

128128
in_fixture "deps_status", fn ->
129129
Mix.Tasks.Deps.run []
130130

131-
msg = " the dependency defined in mix.exs did not specify a supported scm, " <>
132-
"expected one of :git, :path, :in_umbrella " <>
133-
"or the package manager Hex to be installed"
134-
assert_received { :mix_shell, :info, ["* ok"] }
131+
msg = " the dependency ok in mix.exs did not specify a supported scm. " <>
132+
"Please ensure a package manager (like http://hex.pm/) is available or " <>
133+
"give one of :git, :path or :in_umbrella as option"
135134
assert_received { :mix_shell, :info, [^msg] }
136135
end
137136
end

0 commit comments

Comments
 (0)