Skip to content

Commit

Permalink
Fix typos and improve language (#4462)
Browse files Browse the repository at this point in the history
  • Loading branch information
preciz committed Jul 26, 2024
1 parent e403496 commit c97c9ba
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/ecto/adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 45,7 @@ defmodule Ecto.Adapter do
calls to the datastore to share cache information:
Repo.checkout(fn ->
for _ <- 100 do
for _ <- 1..100 do
Repo.insert!(%Post{})
end
end)
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/adapter/queryable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 50,7 @@ defmodule Ecto.Adapter.Queryable do
Commands invoked to prepare a query.
It is used on `c:Ecto.Repo.all/2`, `c:Ecto.Repo.update_all/3`,
and `c:Ecto.Repo.delete_all/2`. If returns a tuple, saying if
and `c:Ecto.Repo.delete_all/2`. It returns a tuple, indicating if
this query can be cached or not, and the `prepared` query.
The `prepared` query is any term that will be passed to the
adapter's `c:execute/5`.
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/adapter/transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 9,7 @@ defmodule Ecto.Adapter.Transaction do
Runs the given function inside a transaction.
Returns `{:ok, value}` if the transaction was successful where `value`
is the value return by the function or `{:error, value}` if the transaction
is the value returned by the function or `{:error, value}` if the transaction
was rolled back where `value` is the value given to `rollback/1`.
"""
@callback transaction(adapter_meta, options :: Keyword.t(), function :: fun) ::
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/exceptions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 159,7 @@ defmodule Ecto.InvalidURLError do
def exception(opts) do
url = Keyword.fetch!(opts, :url)
msg = Keyword.fetch!(opts, :message)
msg = "invalid url #{url}, #{msg}. The parsed URL is: #{inspect(URI.parse(url))}"
msg = "invalid URL #{url}, #{msg}. The parsed URL is: #{inspect(URI.parse(url))}"
%__MODULE__{message: msg, url: url}
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 29,7 @@ if Code.ensure_loaded?(Jason.Encoder) do
exposed externally.
You can either map the schemas to remove the :__meta__ field before \
encoding to JSON, or explicit list the JSON fields in your schema:
encoding to JSON, or explicitly list the JSON fields in your schema:
defmodule #{inspect(schema)} do
# ...
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/query/builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 1089,7 @@ defmodule Ecto.Query.Builder do

@doc """
Checks if the field is an atom at compilation time or
delegate the check to runtime for interpolation.
delegates the check to runtime for interpolation.
"""
def quoted_atom!({:^, _, [expr]}, used_ref),
do: quote(do: Ecto.Query.Builder.atom!(unquote(expr), unquote(used_ref)))
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/query/builder/order_by.ex
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 105,7 @@ defmodule Ecto.Query.Builder.OrderBy do
end

@doc """
Called by at runtime to verify the direction.
Called at runtime to verify the direction.
"""
def dir!(_kind, dir) when dir in @directions,
do: dir
Expand Down
4 changes: 2 additions & 2 deletions lib/ecto/query/builder/update.ex
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 92,7 @@ defmodule Ecto.Query.Builder.Update do

defp compile_error!(expr) do
Builder.error! "malformed update `#{Macro.to_string(expr)}` in query expression, " <>
"expected a keyword list with set/push/pop as keys with field-value " <>
"expected a keyword list with set/push/pull as keys with field-value " <>
"pairs as values"
end

Expand Down Expand Up @@ -186,7 186,7 @@ defmodule Ecto.Query.Builder.Update do
defp runtime_error!(value) do
raise ArgumentError,
"malformed update `#{inspect(value)}` in query expression, " <>
"expected a keyword list with set/push/pop as keys with field-value pairs as values"
"expected a keyword list with set/push/pull as keys with field-value pairs as values"
end

defp validate_op!(key) when key in @keys, do: :ok
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/repo/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 153,7 @@ defmodule Ecto.Repo.Supervisor do
_ ->
raise Ecto.InvalidURLError,
url: url,
message: "can not parse value `#{value}` for parameter `#{key}` as an integer"
message: "cannot parse value `#{value}` for parameter `#{key}` as an integer"
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/ecto/schema/loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 24,7 @@ defmodule Ecto.Schema.Loader do
@doc """
Loads data coming from the user/embeds into schema.
Assumes data does not all belongs to schema/struct
Assumes data does not all belong to schema/struct
and that it may also require source-based renaming.
"""
def unsafe_load(schema, data, loader) do
Expand All @@ -36,7 36,7 @@ defmodule Ecto.Schema.Loader do
@doc """
Loads data coming from the user/embeds into struct and types.
Assumes data does not all belongs to schema/struct
Assumes data does not all belong to schema/struct
and that it may also require source-based renaming.
"""
def unsafe_load(struct, types, map, loader) when is_map(map) do
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/uuid.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 24,7 @@ defmodule Ecto.UUID do
If `uuid` is neither of these, `:error` will be returned.
Since both binaries and strings are represent as binaries, this means some
Since both binaries and strings are represented as binaries, this means some
strings you may not expect are actually also valid UUIDs in their binary form
and so will be casted into their string form.
Expand Down
2 changes: 1 addition & 1 deletion test/ecto/repo/supervisor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 196,7 @@ defmodule Ecto.Repo.SupervisorTest do

for key <- ["timeout", "pool_size", "idle_interval"] do
assert_raise Ecto.InvalidURLError,
~r"can not parse value `not_an_int` for parameter `#{key}` as an integer",
~r"cannot parse value `not_an_int` for parameter `#{key}` as an integer",
fn ->
parse_url("ecto://eric:it й@host:12345/mydb?#{key}=not_an_int")
end
Expand Down

0 comments on commit c97c9ba

Please sign in to comment.