From 158cd00cfec917da160b9966eed515efda9097b0 Mon Sep 17 00:00:00 2001 From: L-e-x-o-n <44340857+L-e-x-o-n@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:49:15 +0200 Subject: [PATCH] mix format --- lib/teiserver/battle/libs/match_lib.ex | 6 +++-- .../controllers/report/rating_controller.ex | 7 +++--- test/teiserver/coordinator/memes_test.exs | 2 +- .../live/microblog/blog/index_live_test.exs | 24 ++++++++++++++++--- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/lib/teiserver/battle/libs/match_lib.ex b/lib/teiserver/battle/libs/match_lib.ex index 9e26f1a0f..1b23b37e2 100644 --- a/lib/teiserver/battle/libs/match_lib.ex +++ b/lib/teiserver/battle/libs/match_lib.ex @@ -28,8 +28,10 @@ defmodule Teiserver.Battle.MatchLib do String.contains?(bot_names, "Raptor") -> "Raptors" Enum.empty?(bots) == false -> "Bots" team_count == 2 and team_size == 1 -> "Duel" - team_count == 2 and team_size <= 5 -> "Small Team" # 2v2, 3v3, 4v4, 5v5 - team_count == 2 and team_size > 5 -> "Big Team" # 6v6, 7v7, 8v8 + # 2v2, 3v3, 4v4, 5v5 + team_count == 2 and team_size <= 5 -> "Small Team" + # 6v6, 7v7, 8v8 + team_count == 2 and team_size > 5 -> "Big Team" team_size == 1 -> "FFA" true -> "Team FFA" end diff --git a/lib/teiserver_web/controllers/report/rating_controller.ex b/lib/teiserver_web/controllers/report/rating_controller.ex index 5e5c58801..22c8113c4 100644 --- a/lib/teiserver_web/controllers/report/rating_controller.ex +++ b/lib/teiserver_web/controllers/report/rating_controller.ex @@ -13,8 +13,8 @@ defmodule TeiserverWeb.Report.RatingController do action: {Phoenix.Controller, :action_name}, user: {Teiserver.Account.AuthLib, :current_user} - plug(:add_breadcrumb, name: 'Reports', url: '/teiserver/reports') - plug(:add_breadcrumb, name: 'Reports', url: '/teiserver/reports/ratings') + plug(:add_breadcrumb, name: ~c"Reports", url: ~c"/teiserver/reports") + plug(:add_breadcrumb, name: ~c"Reports", url: ~c"/teiserver/reports/ratings") @spec distribution_table(Plug.Conn.t(), map) :: Plug.Conn.t() def distribution_table(conn, _params) do @@ -55,7 +55,8 @@ defmodule TeiserverWeb.Report.RatingController do rating_type = cond do Enum.count(player_ids) == 2 -> "Duel" - true -> "Big Team" # Should probably get rating based on team size instad + # Should probably get rating based on team size instad + true -> "Big Team" end rating_lookup = diff --git a/test/teiserver/coordinator/memes_test.exs b/test/teiserver/coordinator/memes_test.exs index d467b1835..43a6e6b10 100644 --- a/test/teiserver/coordinator/memes_test.exs +++ b/test/teiserver/coordinator/memes_test.exs @@ -73,7 +73,7 @@ defmodule Teiserver.Coordinator.MemesTest do assert reply == %{ "cmd" => "s.lobby.update_values", - "lobby_id" => lobby_id, + "lobby_id" => lobby_id, "new_values" => %{ "disabled_units" => ~w(armaap armalab armap armavp armhp armshltx armvp armamsub armasy armfhp armplat armshltxuw armsy armmg armllt armbeamer armhlt arm armdrag armclaw armguard armjuno armham armjeth armpw armrectr armrock armwar coraap coralab corap coravp corgant corhp corlab corvp corllt corfhp corsy corjuno corhllt corhlt) diff --git a/test/teiserver_web/live/microblog/blog/index_live_test.exs b/test/teiserver_web/live/microblog/blog/index_live_test.exs index f6137ea31..134451508 100644 --- a/test/teiserver_web/live/microblog/blog/index_live_test.exs +++ b/test/teiserver_web/live/microblog/blog/index_live_test.exs @@ -17,15 +17,33 @@ defmodule TeiserverWeb.Microblog.Blog.IndexLiveTest do tag2 = tag_fixture() tag3 = tag_fixture() - post1 = post_fixture(title: "Post 1 title", summary: "Post 1 line1", contents: "Post 1 line1\n\nPost 1 fold line") + post1 = + post_fixture( + title: "Post 1 title", + summary: "Post 1 line1", + contents: "Post 1 line1\n\nPost 1 fold line" + ) + _post1_tag1 = post_tag_fixture(post_id: post1.id, tag_id: tag1.id) _post1_tag2 = post_tag_fixture(post_id: post1.id, tag_id: tag2.id) - post2 = post_fixture(title: "Post 2 title", summary: "Post 2 line1", contents: "Post 2 line1\n\nPost 2 fold line") + post2 = + post_fixture( + title: "Post 2 title", + summary: "Post 2 line1", + contents: "Post 2 line1\n\nPost 2 fold line" + ) + _post2_tag1 = post_tag_fixture(post_id: post2.id, tag_id: tag1.id) _post2_tag3 = post_tag_fixture(post_id: post2.id, tag_id: tag3.id) - post3 = post_fixture(title: "Post 3 title", summary: "Post 3 line1", contents: "Post 3 line1\n\nPost 3 fold line") + post3 = + post_fixture( + title: "Post 3 title", + summary: "Post 3 line1", + contents: "Post 3 line1\n\nPost 3 fold line" + ) + _post3_tag2 = post_tag_fixture(post_id: post3.id, tag_id: tag2.id) _post3_tag3 = post_tag_fixture(post_id: post3.id, tag_id: tag3.id)