Skip to content

Commit 776b07f

Browse files
committed
Fixed typos in Mix.Deps. Updated error strings in test cases
1 parent 1f00e01 commit 776b07f

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

lib/mix/lib/mix/deps.ex

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ defrecord Mix.Dep, [ scm: nil, app: nil, requirement: nil, status: nil, opts: ni
22
deps: [], source: nil, manager: nil, from: nil ] do
33
@moduledoc """
44
This is a record that keeps information about your project
5-
dependencies. It keeps:
6-
7-
* scm - a module representing the source code management tool (SCM) operations;
8-
* app - the app name as an atom;
9-
* requirement - a binary or regex with the dep's requirement
10-
* status - the current status of dependency, check `Mix.Deps.format_status/1` for more info;
11-
* opts - the options given by the developer
12-
* deps - dependencies of this dependency
13-
* source - any possible configuration associated with the manager field,
14-
rebar.config for rebar or the Mix.Project for Mix
15-
* manager - the project management, possible values: :rebar | :mix | :make | nil
16-
* from - path to file where dependency was defined
5+
dependencies. It contains:
6+
7+
* `scm` - a module representing the source code management tool (SCM) operations;
8+
* `app` - the application name as an atom;
9+
* `requirement` - a binary or regex with the dependency's requirement
10+
* `status` - the current status of the dependency, check `Mix.Deps.format_status/1` for more info;
11+
* `opts` - the options given by the developer
12+
* `deps` - dependencies of this dependency
13+
* `source` - any possible configuration associated with the `manager` field,
14+
`rebar.config` for rebar or the `Mix.Project` for Mix
15+
* `manager` - the project management, possible values: `:rebar` | `:mix` | `:make` | `nil`
16+
* `from` - path to the file where the dependency was defined
1717
"""
1818
end
1919

@@ -23,20 +23,20 @@ defmodule Mix.Deps do
2323
"""
2424

2525
@doc """
26-
Returns all dependencies recursively as `Mix.Dep` record.
26+
Return all dependencies recursively as a `Mix.Dep` record.
2727
2828
## Exceptions
2929
30-
This function raises an exception in case the developer
31-
provides a dependency in the wrong format.
30+
This function raises an exception if the provided
31+
dependency is in the wrong format.
3232
"""
3333
def all do
3434
{ deps, _ } = Mix.Deps.Converger.all(nil, fn(dep, acc) -> { dep, acc } end)
3535
deps
3636
end
3737

3838
@doc """
39-
Returns all dependencies but with a custom callback and
39+
Return all dependencies, but with a custom callback and
4040
accumulator.
4141
"""
4242
def all(acc, callback) do
@@ -45,12 +45,12 @@ defmodule Mix.Deps do
4545
end
4646

4747
@doc """
48-
Returns all direct child dependencies.
48+
Return all direct child dependencies.
4949
"""
5050
defdelegate children(), to: Mix.Deps.Retriever
5151

5252
@doc """
53-
Returns all dependencies depending on given dependencies.
53+
Return all dependencies depending on the given dependencies.
5454
"""
5555
def depending(deps, all_deps // all)
5656

@@ -69,7 +69,7 @@ defmodule Mix.Deps do
6969
end
7070

7171
@doc """
72-
Receives a list of deps names and returns deps records.
72+
Receives a list of dependency names and returns dependency records.
7373
Logs a message if the dependency could not be found.
7474
"""
7575
def by_name(given, all_deps // all) do
@@ -93,9 +93,9 @@ defmodule Mix.Deps do
9393
end
9494

9595
@doc """
96-
Runs the given `fun` inside the given dependency project by
96+
Run the given `fun` inside the given dependency project by
9797
changing the current working directory and loading the given
98-
project into the project stack.
98+
project onto the project stack.
9999
"""
100100
def in_dependency(dep, post_config // [], fun)
101101

@@ -123,13 +123,13 @@ defmodule Mix.Deps do
123123
end
124124

125125
@doc """
126-
Formats the status of a dependency.
126+
Format the status of a dependency.
127127
"""
128128
def format_status(Mix.Dep[status: { :ok, _vsn }]),
129129
do: "ok"
130130

131131
def format_status(Mix.Dep[status: { :noappfile, path }]),
132-
do: "could not find app file at #{Mix.Utils.relative_to_cwd(path)}"
132+
do: "could not find an app file at #{Mix.Utils.relative_to_cwd(path)}"
133133

134134
def format_status(Mix.Dep[status: { :invalidapp, path }]),
135135
do: "the app file at #{Mix.Utils.relative_to_cwd(path)} is invalid"
@@ -160,7 +160,7 @@ defmodule Mix.Deps do
160160
do: "the dependency is not available, run `mix deps.get`"
161161

162162
@doc """
163-
Checks the lock for the given dependency and update its status accordingly.
163+
Check the lock for the given dependency and update its status accordingly.
164164
"""
165165
def check_lock(Mix.Dep[scm: scm, app: app, opts: opts] = dep, lock) do
166166
if available?(dep) do
@@ -179,7 +179,7 @@ defmodule Mix.Deps do
179179
end
180180

181181
@doc """
182-
Updates the dependency inside the given project.
182+
Update the dependency inside the given project.
183183
"""
184184
defdelegate update(dep), to: Mix.Deps.Retriever
185185

@@ -205,7 +205,7 @@ defmodule Mix.Deps do
205205
end
206206

207207
@doc """
208-
Check if a dependency is out of date or not, considering its
208+
Check if a dependency is out of date, considering its
209209
lock status. Therefore, be sure to call `check_lock` before
210210
invoking this function.
211211
"""
@@ -214,7 +214,7 @@ defmodule Mix.Deps do
214214
def out_of_date?(dep), do: not available?(dep)
215215

216216
@doc """
217-
Format the dependency for printing.
217+
Format a dependency for printing.
218218
"""
219219
def format_dep(Mix.Dep[scm: scm, app: app, status: status, opts: opts]) do
220220
version =
@@ -227,7 +227,7 @@ defmodule Mix.Deps do
227227
end
228228

229229
@doc """
230-
Returns all compile paths for the dependency.
230+
Return all compile paths for the dependency.
231231
"""
232232
def compile_paths(Mix.Dep[app: app, opts: opts, manager: manager]) do
233233
if manager == :mix do
@@ -240,7 +240,7 @@ defmodule Mix.Deps do
240240
end
241241

242242
@doc """
243-
Returns all load paths for the dependency.
243+
Return all load paths for the dependency.
244244
"""
245245
def load_paths(Mix.Dep[manager: :mix, app: app, opts: opts]) do
246246
paths = Mix.Project.in_project app, opts[:dest], fn _ ->
@@ -267,21 +267,21 @@ defmodule Mix.Deps do
267267
end
268268

269269
@doc """
270-
Returns true if dependency is a mix project.
270+
Return `true` if dependency is a mix project.
271271
"""
272272
def mix?(Mix.Dep[manager: manager]) do
273273
manager == :mix
274274
end
275275

276276
@doc """
277-
Returns true if dependency is a rebar project.
277+
Return `true` if dependency is a rebar project.
278278
"""
279279
def rebar?(Mix.Dep[manager: manager]) do
280280
manager == :rebar
281281
end
282282

283283
@doc """
284-
Returns true if dependency is a make project.
284+
Return `true` if dependency is a make project.
285285
"""
286286
def make?(Mix.Dep[manager: manager]) do
287287
manager == :make

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ defmodule Mix.Tasks.DepsTest do
6565
assert_received { :mix_shell, :info, ["* invalidapp [path: \"deps/invalidapp\"]"] }
6666
assert_received { :mix_shell, :info, [" the app file at deps/invalidapp/ebin/invalidapp.app is invalid"] }
6767
assert_received { :mix_shell, :info, ["* noappfile [path: \"deps/noappfile\"]"] }
68-
assert_received { :mix_shell, :info, [" could not find app file at deps/noappfile/ebin/noappfile.app"] }
68+
assert_received { :mix_shell, :info, [" could not find an app file at deps/noappfile/ebin/noappfile.app"] }
6969
assert_received { :mix_shell, :info, ["* uncloned [git: \"https://github.com/elixir-lang/uncloned.git\"]"] }
7070
assert_received { :mix_shell, :info, [" the dependency is not available, run `mix deps.get`"] }
7171
end
@@ -131,7 +131,7 @@ defmodule Mix.Tasks.DepsTest do
131131
assert_received { :mix_shell, :error, ["* invalidapp [path: \"deps/invalidapp\"]"] }
132132
assert_received { :mix_shell, :error, [" the app file at deps/invalidapp/ebin/invalidapp.app is invalid"] }
133133
assert_received { :mix_shell, :error, ["* noappfile [path: \"deps/noappfile\"]"] }
134-
assert_received { :mix_shell, :error, [" could not find app file at deps/noappfile/ebin/noappfile.app"] }
134+
assert_received { :mix_shell, :error, [" could not find an app file at deps/noappfile/ebin/noappfile.app"] }
135135
assert_received { :mix_shell, :error, ["* uncloned [git: \"https://github.com/elixir-lang/uncloned.git\"]"] }
136136
assert_received { :mix_shell, :error, [" the dependency is not available, run `mix deps.get`"] }
137137
end

0 commit comments

Comments
 (0)