Skip to content

Commit

Permalink
Fix results from $ mix credo suggest --all --strict
Browse files Browse the repository at this point in the history
  • Loading branch information
iamvery committed Nov 10, 2023
1 parent ec227f7 commit 07f24b3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/display.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Display do
use GenServer

alias IO.ANSI
alias Display.{ProgressBar, Intro, Failure, Notifications}
alias Display.{Failure, Intro, Notifications, ProgressBar}

def start_link do
GenServer.start_link(__MODULE__, %{clear_screen: true}, name: __MODULE__)
Expand Down
30 changes: 12 additions & 18 deletions lib/koans.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ defmodule Koans do
generate_test_method(unquote(compiled_name), unquote(number_of_args), unquote(body))

def unquote(compiled_name)() do
try do
unquote(compiled_body)
:ok
rescue
e -> {:error, __STACKTRACE__, e}
end
unquote(compiled_body)
:ok
rescue
e -> {:error, __STACKTRACE__, e}
end
end
end
Expand All @@ -36,12 +34,10 @@ defmodule Koans do

quote do
def unquote(name)(answer) do
try do
unquote(single_var)
:ok
rescue
e -> {:error, __STACKTRACE__, e}
end
unquote(single_var)
:ok
rescue
e -> {:error, __STACKTRACE__, e}
end
end
end
Expand All @@ -54,12 +50,10 @@ defmodule Koans do

quote do
def unquote(name)({:multiple, unquote(answer_vars)}) do
try do
unquote(multi_var)
:ok
rescue
e -> {:error, __STACKTRACE__, e}
end
unquote(multi_var)
:ok
rescue
e -> {:error, __STACKTRACE__, e}
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tracker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule Tracker do
end
end

def wait_until_complete() do
def wait_until_complete do
pid = Process.whereis(Tracker)

receive do
Expand Down
2 changes: 1 addition & 1 deletion lib/watcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Watcher do
@moduledoc false
use GenServer

def start_link() do
def start_link do
GenServer.start_link(__MODULE__, dirs: ["lib/koans"])
end

Expand Down

0 comments on commit 07f24b3

Please sign in to comment.