Skip to content

Commit 9c5f3aa

Browse files
committed
Apply review comments
1 parent cb4a98d commit 9c5f3aa

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/gradient/elixir_checker.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ defmodule Gradient.ElixirChecker do
1919
Check if all specs are exactly before the function that they specify
2020
and if there is only one spec per function clause.
2121
22-
Correct specs location:
22+
Correct spec locations:
2323
```
2424
@spec convert(integer()) :: float()
2525
def convert(int) when is_integer(int), do: int / 1
26+
2627
@spec convert(atom()) :: binary()
2728
def convert(atom) when is_atom(atom), do: to_string(atom)
2829
```
2930
30-
Incorrect specs location:
31+
Incorrect spec locations:
3132
- More than one spec above function clause.
3233
```
3334
@spec convert(integer()) :: float()

lib/gradient/elixir_fmt.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ defmodule Gradient.ElixirFmt do
8686

8787
def format_type_error({:spec_error, :spec_after_spec, anno, name, arity}, opts) do
8888
:io_lib.format(
89-
"~sThe spec ~p/~p~s follows another spec when only one spec per function clause is allowed~n",
89+
"~sThe spec ~p/~p~s follows another spec, but only one spec per function clause is allowed~n",
9090
[
9191
format_location(anno, :brief, opts),
9292
name,

test/gradient/elixir_fmt_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ defmodule Gradient.ElixirFmtTest do
255255
|> ElixirFmt.format_error([])
256256
|> :erlang.iolist_to_binary()
257257

258-
assert "The spec convert/1 on line 3 follows another spec when only one spec per function clause is allowed\n" =
258+
assert "The spec convert/1 on line 3 follows another spec, but only one spec per function clause is allowed\n" =
259259
msg
260260
end
261261
end

0 commit comments

Comments
 (0)