Skip to content

Commit 772b6a4

Browse files
authored
chore: mix format (#986)
1 parent df8e067 commit 772b6a4

17 files changed

Lines changed: 116 additions & 79 deletions

File tree

test_integrations/phoenix_app/lib/phoenix_app/test_client.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ defmodule PhoenixApp.TestClient do
4646
with {:ok, header_line, rest} <- get_first_line(lines),
4747
{:ok, envelope_headers} <- Jason.decode(header_line),
4848
{:ok, items} <- parse_items(rest) do
49-
5049
envelope = %{
5150
headers: envelope_headers,
5251
items: items

test_integrations/phoenix_app/lib/phoenix_app_web/components/core_components.ex

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ defmodule PhoenixAppWeb.CoreComponents do
7979
</button>
8080
</div>
8181
<div id={"#{@id}-content"}>
82-
<%= render_slot(@inner_block) %>
82+
{render_slot(@inner_block)}
8383
</div>
8484
</.focus_wrap>
8585
</div>
@@ -124,9 +124,9 @@ defmodule PhoenixAppWeb.CoreComponents do
124124
<p :if={@title} class="flex items-center gap-1.5 text-sm font-semibold leading-6">
125125
<.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-4 w-4" />
126126
<.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-4 w-4" />
127-
<%= @title %>
127+
{@title}
128128
</p>
129-
<p class="mt-2 text-sm leading-5"><%= msg %></p>
129+
<p class="mt-2 text-sm leading-5">{msg}</p>
130130
<button type="button" class="group absolute top-1 right-1 p-2" aria-label={gettext("close")}>
131131
<.icon name="hero-x-mark-solid" class="h-5 w-5 opacity-40 group-hover:opacity-70" />
132132
</button>
@@ -157,7 +157,7 @@ defmodule PhoenixAppWeb.CoreComponents do
157157
phx-connected={hide("#client-error")}
158158
hidden
159159
>
160-
<%= gettext("Attempting to reconnect") %>
160+
{gettext("Attempting to reconnect")}
161161
<.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
162162
</.flash>
163163
@@ -169,7 +169,7 @@ defmodule PhoenixAppWeb.CoreComponents do
169169
phx-connected={hide("#server-error")}
170170
hidden
171171
>
172-
<%= gettext("Hang in there while we get back on track") %>
172+
{gettext("Hang in there while we get back on track")}
173173
<.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
174174
</.flash>
175175
</div>
@@ -203,9 +203,9 @@ defmodule PhoenixAppWeb.CoreComponents do
203203
~H"""
204204
<.form :let={f} for={@for} as={@as} {@rest}>
205205
<div class="mt-10 space-y-8 bg-white">
206-
<%= render_slot(@inner_block, f) %>
206+
{render_slot(@inner_block, f)}
207207
<div :for={action <- @actions} class="mt-2 flex items-center justify-between gap-6">
208-
<%= render_slot(action, f) %>
208+
{render_slot(action, f)}
209209
</div>
210210
</div>
211211
</.form>
@@ -237,7 +237,7 @@ defmodule PhoenixAppWeb.CoreComponents do
237237
]}
238238
{@rest}
239239
>
240-
<%= render_slot(@inner_block) %>
240+
{render_slot(@inner_block)}
241241
</button>
242242
"""
243243
end
@@ -321,36 +321,36 @@ defmodule PhoenixAppWeb.CoreComponents do
321321
class="rounded border-zinc-300 text-zinc-900 focus:ring-0"
322322
{@rest}
323323
/>
324-
<%= @label %>
324+
{@label}
325325
</label>
326-
<.error :for={msg <- @errors}><%= msg %></.error>
326+
<.error :for={msg <- @errors}>{msg}</.error>
327327
</div>
328328
"""
329329
end
330330

331331
def input(%{type: "select"} = assigns) do
332332
~H"""
333333
<div>
334-
<.label for={@id}><%= @label %></.label>
334+
<.label for={@id}>{@label}</.label>
335335
<select
336336
id={@id}
337337
name={@name}
338338
class="mt-2 block w-full rounded-md border border-gray-300 bg-white shadow-sm focus:border-zinc-400 focus:ring-0 sm:text-sm"
339339
multiple={@multiple}
340340
{@rest}
341341
>
342-
<option :if={@prompt} value=""><%= @prompt %></option>
343-
<%= Phoenix.HTML.Form.options_for_select(@options, @value) %>
342+
<option :if={@prompt} value="">{@prompt}</option>
343+
{Phoenix.HTML.Form.options_for_select(@options, @value)}
344344
</select>
345-
<.error :for={msg <- @errors}><%= msg %></.error>
345+
<.error :for={msg <- @errors}>{msg}</.error>
346346
</div>
347347
"""
348348
end
349349

350350
def input(%{type: "textarea"} = assigns) do
351351
~H"""
352352
<div>
353-
<.label for={@id}><%= @label %></.label>
353+
<.label for={@id}>{@label}</.label>
354354
<textarea
355355
id={@id}
356356
name={@name}
@@ -361,7 +361,7 @@ defmodule PhoenixAppWeb.CoreComponents do
361361
]}
362362
{@rest}
363363
><%= Phoenix.HTML.Form.normalize_value("textarea", @value) %></textarea>
364-
<.error :for={msg <- @errors}><%= msg %></.error>
364+
<.error :for={msg <- @errors}>{msg}</.error>
365365
</div>
366366
"""
367367
end
@@ -370,7 +370,7 @@ defmodule PhoenixAppWeb.CoreComponents do
370370
def input(assigns) do
371371
~H"""
372372
<div>
373-
<.label for={@id}><%= @label %></.label>
373+
<.label for={@id}>{@label}</.label>
374374
<input
375375
type={@type}
376376
name={@name}
@@ -383,7 +383,7 @@ defmodule PhoenixAppWeb.CoreComponents do
383383
]}
384384
{@rest}
385385
/>
386-
<.error :for={msg <- @errors}><%= msg %></.error>
386+
<.error :for={msg <- @errors}>{msg}</.error>
387387
</div>
388388
"""
389389
end
@@ -397,7 +397,7 @@ defmodule PhoenixAppWeb.CoreComponents do
397397
def label(assigns) do
398398
~H"""
399399
<label for={@for} class="block text-sm font-semibold leading-6 text-zinc-800">
400-
<%= render_slot(@inner_block) %>
400+
{render_slot(@inner_block)}
401401
</label>
402402
"""
403403
end
@@ -411,7 +411,7 @@ defmodule PhoenixAppWeb.CoreComponents do
411411
~H"""
412412
<p class="mt-3 flex gap-3 text-sm leading-6 text-rose-600">
413413
<.icon name="hero-exclamation-circle-mini" class="mt-0.5 h-5 w-5 flex-none" />
414-
<%= render_slot(@inner_block) %>
414+
{render_slot(@inner_block)}
415415
</p>
416416
"""
417417
end
@@ -430,13 +430,13 @@ defmodule PhoenixAppWeb.CoreComponents do
430430
<header class={[@actions != [] && "flex items-center justify-between gap-6", @class]}>
431431
<div>
432432
<h1 class="text-lg font-semibold leading-8 text-zinc-800">
433-
<%= render_slot(@inner_block) %>
433+
{render_slot(@inner_block)}
434434
</h1>
435435
<p :if={@subtitle != []} class="mt-2 text-sm leading-6 text-zinc-600">
436-
<%= render_slot(@subtitle) %>
436+
{render_slot(@subtitle)}
437437
</p>
438438
</div>
439-
<div class="flex-none"><%= render_slot(@actions) %></div>
439+
<div class="flex-none">{render_slot(@actions)}</div>
440440
</header>
441441
"""
442442
end
@@ -477,9 +477,9 @@ defmodule PhoenixAppWeb.CoreComponents do
477477
<table class="w-[40rem] mt-11 sm:w-full">
478478
<thead class="text-sm text-left leading-6 text-zinc-500">
479479
<tr>
480-
<th :for={col <- @col} class="p-0 pb-4 pr-6 font-normal"><%= col[:label] %></th>
480+
<th :for={col <- @col} class="p-0 pb-4 pr-6 font-normal">{col[:label]}</th>
481481
<th :if={@action != []} class="relative p-0 pb-4">
482-
<span class="sr-only"><%= gettext("Actions") %></span>
482+
<span class="sr-only">{gettext("Actions")}</span>
483483
</th>
484484
</tr>
485485
</thead>
@@ -497,7 +497,7 @@ defmodule PhoenixAppWeb.CoreComponents do
497497
<div class="block py-4 pr-6">
498498
<span class="absolute -inset-y-px right-0 -left-4 group-hover:bg-zinc-50 sm:rounded-l-xl" />
499499
<span class={["relative", i == 0 && "font-semibold text-zinc-900"]}>
500-
<%= render_slot(col, @row_item.(row)) %>
500+
{render_slot(col, @row_item.(row))}
501501
</span>
502502
</div>
503503
</td>
@@ -508,7 +508,7 @@ defmodule PhoenixAppWeb.CoreComponents do
508508
:for={action <- @action}
509509
class="relative ml-4 font-semibold leading-6 text-zinc-900 hover:text-zinc-700"
510510
>
511-
<%= render_slot(action, @row_item.(row)) %>
511+
{render_slot(action, @row_item.(row))}
512512
</span>
513513
</div>
514514
</td>
@@ -538,8 +538,8 @@ defmodule PhoenixAppWeb.CoreComponents do
538538
<div class="mt-14">
539539
<dl class="-my-4 divide-y divide-zinc-100">
540540
<div :for={item <- @item} class="flex gap-4 py-4 text-sm leading-6 sm:gap-8">
541-
<dt class="w-1/4 flex-none text-zinc-500"><%= item.title %></dt>
542-
<dd class="text-zinc-700"><%= render_slot(item) %></dd>
541+
<dt class="w-1/4 flex-none text-zinc-500">{item.title}</dt>
542+
<dd class="text-zinc-700">{render_slot(item)}</dd>
543543
</div>
544544
</dl>
545545
</div>
@@ -564,7 +564,7 @@ defmodule PhoenixAppWeb.CoreComponents do
564564
class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700"
565565
>
566566
<.icon name="hero-arrow-left-solid" class="h-3 w-3" />
567-
<%= render_slot(@inner_block) %>
567+
{render_slot(@inner_block)}
568568
</.link>
569569
</div>
570570
"""

test_integrations/phoenix_app/lib/phoenix_app_web/components/layouts/app.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img src={~p"/images/logo.svg"} width="36" />
66
</a>
77
<p class="bg-brand/5 text-brand rounded-full px-2 font-medium leading-6">
8-
v<%= Application.spec(:phoenix, :vsn) %>
8+
v{Application.spec(:phoenix, :vsn)}
99
</p>
1010
</div>
1111
<div class="flex items-center gap-4 font-semibold leading-6 text-zinc-900">
@@ -27,6 +27,6 @@
2727
<main class="px-4 py-20 sm:px-6 lg:px-8">
2828
<div class="mx-auto max-w-2xl">
2929
<.flash_group flash={@flash} />
30-
<%= @inner_content %>
30+
{@inner_content}
3131
</div>
3232
</main>

test_integrations/phoenix_app/lib/phoenix_app_web/components/layouts/root.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
66
<meta name="csrf-token" content={get_csrf_token()} />
77
<.live_title suffix=" · Phoenix Framework">
8-
<%= assigns[:page_title] || "PhoenixApp" %>
8+
{assigns[:page_title] || "PhoenixApp"}
99
</.live_title>
1010
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
1111
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
1212
</script>
1313
</head>
1414
<body class="bg-white">
15-
<%= @inner_content %>
15+
{@inner_content}
1616
</body>
1717
</html>

test_integrations/phoenix_app/lib/phoenix_app_web/controllers/page_controller.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ defmodule PhoenixAppWeb.PageController do
9292
# 2. Visit: http://localhost:4000/logs
9393
# 3. Check Sentry logs - they should have trace_id matching the transaction traces
9494
def logs_demo(conn, params) do
95-
request_id = get_req_header(conn, "x-request-id") |> List.first() || "demo-#{:rand.uniform(10000)}"
95+
request_id =
96+
get_req_header(conn, "x-request-id") |> List.first() || "demo-#{:rand.uniform(10000)}"
97+
9698
user_id = Map.get(params, "user_id", 123)
9799

98100
# Set logger metadata
@@ -122,6 +124,7 @@ defmodule PhoenixAppWeb.PageController do
122124

123125
Tracer.with_span "database_query" do
124126
users = Repo.all(User)
127+
125128
Logger.info("Database query completed",
126129
query: "SELECT * FROM users",
127130
result_count: length(users)

test_integrations/phoenix_app/lib/phoenix_app_web/controllers/page_html/home.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<h1 class="text-brand mt-10 flex items-center text-sm font-semibold leading-6">
5050
Phoenix Framework
5151
<small class="bg-brand/5 text-[0.8125rem] ml-3 rounded-full px-2 font-medium leading-6">
52-
v<%= Application.spec(:phoenix, :vsn) %>
52+
v{Application.spec(:phoenix, :vsn)}
5353
</small>
5454
</h1>
5555
<p class="text-[2rem] mt-4 font-semibold leading-10 tracking-tighter text-zinc-900 text-balance">

test_integrations/phoenix_app/lib/phoenix_app_web/live/test_worker_live.html.heex

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,46 @@
88
<div>
99
<label class="block text-sm font-medium text-gray-700">Sleep Time (ms)</label>
1010
<div class="mt-1">
11-
<input type="number" name="test_job[sleep_time]" value="1000" min="0"
12-
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" />
11+
<input
12+
type="number"
13+
name="test_job[sleep_time]"
14+
value="1000"
15+
min="0"
16+
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
17+
/>
1318
</div>
1419
</div>
1520

1621
<div>
1722
<label class="block text-sm font-medium text-gray-700">Queue</label>
18-
<select name="test_job[queue]" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
23+
<select
24+
name="test_job[queue]"
25+
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
26+
>
1927
<option value="default">default</option>
2028
<option value="background">background</option>
2129
</select>
2230
</div>
2331

2432
<div class="relative flex items-start">
2533
<div class="flex h-6 items-center">
26-
<input type="checkbox" name="test_job[should_fail]" value="true"
27-
class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" />
34+
<input
35+
type="checkbox"
36+
name="test_job[should_fail]"
37+
value="true"
38+
class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"
39+
/>
2840
</div>
2941
<div class="ml-3 text-sm leading-6">
3042
<label class="font-medium text-gray-900">Should Fail</label>
3143
</div>
3244
</div>
3345

3446
<div>
35-
<button type="submit" class="inline-flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
47+
<button
48+
type="submit"
49+
class="inline-flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
50+
>
3651
Schedule Job
3752
</button>
3853
</div>
@@ -50,20 +65,25 @@
5065
<div>
5166
<label class="block text-sm font-medium text-gray-700">Number of Jobs</label>
5267
<div class="mt-1">
53-
<input type="number"
54-
name="auto[job_count]"
55-
value="5"
56-
min="1"
57-
max="100"
58-
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" />
68+
<input
69+
type="number"
70+
name="auto[job_count]"
71+
value="5"
72+
min="1"
73+
max="100"
74+
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
75+
/>
5976
</div>
6077
<p class="mt-2 text-sm text-gray-500">
6178
Jobs will be created with random sleep times (500-5000ms), random queues, and random failure states.
6279
</p>
6380
</div>
6481

6582
<div>
66-
<button type="submit" class="inline-flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
83+
<button
84+
type="submit"
85+
class="inline-flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
86+
>
6787
Auto Schedule Jobs
6888
</button>
6989
</div>
@@ -89,11 +109,13 @@
89109
<tbody class="divide-y divide-gray-200 bg-white">
90110
<%= for job <- @jobs do %>
91111
<tr>
92-
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"><%= job.id %></td>
93-
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"><%= job.queue %></td>
94-
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"><%= job.state %></td>
95-
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"><%= job.attempt %></td>
96-
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"><%= inspect(job.args) %></td>
112+
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{job.id}</td>
113+
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{job.queue}</td>
114+
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{job.state}</td>
115+
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{job.attempt}</td>
116+
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
117+
{inspect(job.args)}
118+
</td>
97119
</tr>
98120
<% end %>
99121
</tbody>

0 commit comments

Comments
 (0)