Skip to content

Commit 902a07b

Browse files
committed
chore: format
1 parent cd0d248 commit 902a07b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

lib/igniter.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,18 +2149,21 @@ defmodule Igniter do
21492149
kind = failure_kind(exception)
21502150
task_invocation = format_task_for_log({task_name, args})
21512151
reason = Exception.message(exception)
2152+
21522153
lines = [
21532154
"Task failed (#{kind}): #{task_invocation}",
21542155
"Reason: #{reason}",
21552156
"",
21562157
"Tasks that did not run:",
21572158
Enum.map_join(tasks_not_run, "\n", fn t -> " • " <> t end)
21582159
]
2160+
21592161
Enum.join(lines, "\n")
21602162
end
21612163

21622164
defp failure_kind(%CompileError{}), do: "compile error"
21632165
defp failure_kind(%Mix.Error{}), do: "mix error"
2166+
21642167
defp failure_kind(_) do
21652168
"runtime error"
21662169
end

test/igniter_test.exs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ defmodule IgniterTest do
2020
# Display functions use Mix.shell().info(). Use Process shell so output is sent to the process.
2121
defp assert_display_output(expected, fun) do
2222
Mix.shell(Mix.Shell.Process)
23+
2324
try do
2425
fun.()
2526
# Collect all info messages (shell may send one or more chunks)
2627
payloads = collect_mix_shell_info([])
2728
assert payloads != [], "expected at least one Mix.shell().info message"
29+
2830
formatted =
2931
payloads
3032
|> Enum.map(fn p -> Enum.map_join(List.wrap(p), "", &IO.ANSI.format/1) end)
3133
|> Enum.reject(&(&1 == ""))
3234
|> Enum.join("")
35+
3336
assert formatted == expected
3437
after
3538
Mix.shell(Mix.Shell.IO)
@@ -172,15 +175,18 @@ defmodule IgniterTest do
172175

173176
# display_notices sends two info() calls: list (display_list) then reminder line (info)
174177
Mix.shell(Mix.Shell.Process)
178+
175179
try do
176180
Igniter.display_notices(igniter)
177181
payloads = collect_mix_shell_info([])
178182
assert payloads != []
183+
179184
formatted =
180185
payloads
181186
|> Enum.map(fn p -> Enum.map_join(List.wrap(p), "", &IO.ANSI.format/1) end)
182187
|> Enum.reject(&(&1 == ""))
183188
|> Enum.join("")
189+
184190
assert formatted =~ "Notices:"
185191
assert formatted =~ "notice 1"
186192
assert formatted =~ "notice 2"
@@ -383,6 +389,7 @@ defmodule IgniterTest do
383389
{"help", ["format"], :delayed},
384390
{"help", ["compile"]}
385391
]
392+
386393
assert :ok == Igniter.run_queued_tasks_with_tracking(tasks_with_delayed)
387394
end
388395

0 commit comments

Comments
 (0)