From c4da67c5c7da3e50d4ee9840e8fbca5352d7ff97 Mon Sep 17 00:00:00 2001 From: vtm9 Date: Fri, 24 Nov 2023 17:34:00 +0100 Subject: [PATCH] Fix format --- .../codebattle/lib/codebattle/tournament/strategy/team.ex | 2 +- .../codebattle_web/live/components/tournament/create_form.ex | 5 ++++- .../codebattle_web/live/components/tournament/edit_form.ex | 5 ++++- .../test/codebattle_web/channels/game_channel_test.exs | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/services/app/apps/codebattle/lib/codebattle/tournament/strategy/team.ex b/services/app/apps/codebattle/lib/codebattle/tournament/strategy/team.ex index a2a83b682..487d7f3e2 100644 --- a/services/app/apps/codebattle/lib/codebattle/tournament/strategy/team.ex +++ b/services/app/apps/codebattle/lib/codebattle/tournament/strategy/team.ex @@ -81,7 +81,7 @@ defmodule Codebattle.Tournament.Team do |> Map.values() |> shift_pairs(tournament.current_round) |> Enum.zip() - |> Enum.map(fn {p1, p2} -> [p1,p2] end) + |> Enum.map(fn {p1, p2} -> [p1, p2] end) {tournament, player_pairs} end diff --git a/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/create_form.ex b/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/create_form.ex index 7a7b686cc..d97ce3cbb 100644 --- a/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/create_form.ex +++ b/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/create_form.ex @@ -188,7 +188,10 @@ defmodule CodebattleWeb.Live.Tournament.CreateFormComponent do
<%= label(f, :players_limit) %> - <%= select(f, :players_limit, [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384], + <%= select( + f, + :players_limit, + [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384], value: f.params["players_limit"] || 64, class: "custom-select" ) %> diff --git a/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/edit_form.ex b/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/edit_form.ex index 4b7a32f62..4a0f53c42 100644 --- a/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/edit_form.ex +++ b/services/app/apps/codebattle/lib/codebattle_web/live/components/tournament/edit_form.ex @@ -125,7 +125,10 @@ defmodule CodebattleWeb.Live.Tournament.EditFormComponent do
<%= label(f, :players_limit) %> - <%= select(f, :players_limit, [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384], + <%= select( + f, + :players_limit, + [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384], class: "custom-select" ) %> <%= error_tag(f, :players_limit) %> diff --git a/services/app/apps/codebattle/test/codebattle_web/channels/game_channel_test.exs b/services/app/apps/codebattle/test/codebattle_web/channels/game_channel_test.exs index 241653448..a10ebb129 100644 --- a/services/app/apps/codebattle/test/codebattle_web/channels/game_channel_test.exs +++ b/services/app/apps/codebattle/test/codebattle_web/channels/game_channel_test.exs @@ -25,7 +25,8 @@ defmodule CodebattleWeb.GameChannelTest do {:ok, game} = Game.Context.create_game(%{state: "waiting_opponent", players: [user1], level: "easy"}) - {:ok, %{game: created}, _socket1} = subscribe_and_join(socket1, GameChannel, game_topic(game)) + {:ok, %{game: created}, _socket1} = + subscribe_and_join(socket1, GameChannel, game_topic(game)) assert created.task.level == "easy" assert created.mode == "standard"