Skip to content

Commit ebc19eb

Browse files
committed
style(elixir): run mix format across the orchestration layer
Pre-flight for the new .github/workflows/elixir-ci.yml which runs mix format --check-formatted. 61 files were unformatted; this catches them up so the freshly-added CI workflow doesn't fail on first run. Pure whitespace/style — no semantic changes. https://claude.ai/code/session_01GeiWCLLoZmPdnjMMcy2buu
1 parent e61cd7f commit ebc19eb

61 files changed

Lines changed: 1814 additions & 895 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

elixir-orchestration/config/dev.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ import Config
66
config :verisim,
77
rust_core_url: "http://localhost:8080/api/v1"
88

9-
config :logger, :console,
10-
level: :debug
9+
config :logger, :console, level: :debug

elixir-orchestration/config/prod.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ config :verisim,
77
rust_core_url: System.get_env("VERISIM_RUST_CORE_URL") || "https://verisim-core:8080/api/v1",
88
rust_core_timeout: 60_000
99

10-
config :logger, :console,
11-
level: :info
10+
config :logger, :console, level: :info

elixir-orchestration/config/test.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ config :verisim,
88
rust_core_timeout: 5_000,
99
orch_api_port: 0
1010

11-
config :logger, :console,
12-
level: :warning
11+
config :logger, :console, level: :warning

elixir-orchestration/lib/verisim/api/router.ex

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ defmodule VeriSim.Api.Router do
3434

3535
use Plug.Router
3636

37-
plug :match
38-
plug Plug.Parsers, parsers: [:json], pass: ["application/json"], json_decoder: Jason
39-
plug :set_cors_headers
40-
plug :dispatch
37+
plug(:match)
38+
plug(Plug.Parsers, parsers: [:json], pass: ["application/json"], json_decoder: Jason)
39+
plug(:set_cors_headers)
40+
plug(:dispatch)
4141

4242
# ── Health ────────────────────────────────────────────────────────────
4343

@@ -58,14 +58,16 @@ defmodule VeriSim.Api.Router do
5858
get "/telemetry" do
5959
if VeriSim.Telemetry.Collector.enabled?() do
6060
json_string = VeriSim.Telemetry.Reporter.report_json()
61+
6162
conn
6263
|> put_resp_content_type("application/json")
6364
|> send_resp(200, json_string)
6465
else
6566
json_response(conn, 200, %{
6667
telemetry_enabled: false,
6768
message: "Telemetry collection is disabled. Enable with VERISIM_TELEMETRY=true.",
68-
privacy_notice: "When enabled, only aggregate counters are collected. No PII, no query content."
69+
privacy_notice:
70+
"When enabled, only aggregate counters are collected. No PII, no query content."
6971
})
7072
end
7173
end

elixir-orchestration/lib/verisim/application.ex

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ defmodule VeriSim.Application do
2020

2121
# Dynamic supervisor for entity servers
2222
{DynamicSupervisor,
23-
name: VeriSim.EntitySupervisor,
24-
strategy: :one_for_one,
25-
max_restarts: 100,
26-
max_seconds: 60},
23+
name: VeriSim.EntitySupervisor, strategy: :one_for_one, max_restarts: 100, max_seconds: 60},
2724

2825
# Drift monitor
2926
VeriSim.DriftMonitor,
@@ -39,8 +36,8 @@ defmodule VeriSim.Application do
3936

4037
# KRaft consensus node (single-node bootstrap by default)
4138
{VeriSim.Consensus.KRaftNode,
42-
node_id: Application.get_env(:verisim, :kraft_node_id, "local"),
43-
peers: Application.get_env(:verisim, :kraft_peers, [])},
39+
node_id: Application.get_env(:verisim, :kraft_node_id, "local"),
40+
peers: Application.get_env(:verisim, :kraft_peers, [])},
4441

4542
# Federation resolver
4643
VeriSim.Federation.Resolver,

elixir-orchestration/lib/verisim/consensus/kraft_node.ex

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,7 @@ defmodule VeriSim.Consensus.KRaftNode do
301301
defp start_election(state) do
302302
new_term = state.current_term + 1
303303

304-
Logger.info(
305-
"KRaft: node #{state.node_id} starting election for term #{new_term}"
306-
)
304+
Logger.info("KRaft: node #{state.node_id} starting election for term #{new_term}")
307305

308306
state = %{
309307
state
@@ -404,9 +402,7 @@ defmodule VeriSim.Consensus.KRaftNode do
404402
end
405403

406404
defp become_leader(state) do
407-
Logger.info(
408-
"KRaft: node #{state.node_id} became leader for term #{state.current_term}"
409-
)
405+
Logger.info("KRaft: node #{state.node_id} became leader for term #{state.current_term}")
410406

411407
last_log_index = length(state.log) + 1
412408

@@ -624,7 +620,12 @@ defmodule VeriSim.Consensus.KRaftNode do
624620
"(#{state.last_applied + 1}..#{state.commit_index})"
625621
)
626622

627-
state = %{state | last_applied: state.commit_index, registry: new_registry, peers: new_peers}
623+
state = %{
624+
state
625+
| last_applied: state.commit_index,
626+
registry: new_registry,
627+
peers: new_peers
628+
}
628629

629630
# Update leader tracking structures when peers change
630631
state =
@@ -641,7 +642,8 @@ defmodule VeriSim.Consensus.KRaftNode do
641642
end)
642643

643644
# Remove entries for removed peers
644-
removed = MapSet.difference(MapSet.new(Map.keys(state.next_index)), MapSet.new(new_peers))
645+
removed =
646+
MapSet.difference(MapSet.new(Map.keys(state.next_index)), MapSet.new(new_peers))
645647

646648
new_next_index = Map.drop(new_next_index, MapSet.to_list(removed))
647649
new_match_index = Map.drop(new_match_index, MapSet.to_list(removed))
@@ -692,9 +694,7 @@ defmodule VeriSim.Consensus.KRaftNode do
692694
last_entry.term
693695
)
694696

695-
Logger.info(
696-
"KRaft: node #{state.node_id} saved snapshot at index #{state.last_applied}"
697-
)
697+
Logger.info("KRaft: node #{state.node_id} saved snapshot at index #{state.last_applied}")
698698
end
699699
end
700700

elixir-orchestration/lib/verisim/consensus/kraft_transport.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ defmodule VeriSim.Consensus.KRaftTransport do
116116
send(reply_to, {:append_entries_response, peer_id, response})
117117

118118
{:error, reason} ->
119-
Logger.debug(
120-
"KRaft transport: append_entries to #{peer_id} failed: #{inspect(reason)}"
121-
)
119+
Logger.debug("KRaft transport: append_entries to #{peer_id} failed: #{inspect(reason)}")
122120
end
123121
end)
124122
end

0 commit comments

Comments
 (0)