From 609676f0d7ce6e6a2e8e2a28fed3cf70d1094204 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 14 Jan 2025 17:27:04 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.8.4 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 8efcb37..275a158 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.8.3" +version = "3.8.4" runner.dialect = scala3 From 573644dedf67cec28587961e9bd4e8441fde3006 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 14 Jan 2025 17:27:14 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.8.4 Executed command: scalafmt --non-interactive --- .../org/felher/laminirouter/Routes.scala | 3 +-- .../felher/laminirouter/LaminouterSpec.scala | 25 +++++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main/scala/org/felher/laminirouter/Routes.scala b/src/main/scala/org/felher/laminirouter/Routes.scala index 4bb37ab..f7dab5b 100644 --- a/src/main/scala/org/felher/laminirouter/Routes.scala +++ b/src/main/scala/org/felher/laminirouter/Routes.scala @@ -173,8 +173,7 @@ object Routes: .of[Codec] .appliedTo(vd.tpt.tpe.asType match case '[Option[t]] => TypeRepr.of[t] - case _ => vd.tpt.tpe - ) + case _ => vd.tpt.tpe) Implicits.search(codecType) match case _: ImplicitSearchFailure => sys.error(s"Cannot find implicit codec: ${codecType.show}") diff --git a/src/test/scala/org/felher/laminirouter/LaminouterSpec.scala b/src/test/scala/org/felher/laminirouter/LaminouterSpec.scala index aa9b523..7408fd6 100644 --- a/src/test/scala/org/felher/laminirouter/LaminouterSpec.scala +++ b/src/test/scala/org/felher/laminirouter/LaminouterSpec.scala @@ -16,7 +16,7 @@ object LaminouterSpec extends TestSuite: test("URLs should encode and decode correctly") { for t <- routesToTest do val baseUrl = dom.URL("https://www.heise.de:8080") - val url = dom.URL(t.url) + val url = dom.URL(t.url) assert(routes.encode(baseUrl, t.route).toString == t.url) assert(routes.decode(url).exists(compareRoutes(_, t.route))) } @@ -39,16 +39,25 @@ object LaminouterSpec extends TestSuite: a1 == b1 && a2 == b2 && a.page == b.page && a.filter == b.filter case _ => false - private final case class Test( - route: Route, - url: String, + final private case class Test( + route: Route, + url: String ) - private final val routesToTest = List( + final private val routesToTest = List( Test(Route.Home, "https://www.heise.de:8080/home"), Test(Route.SingleParam(123), "https://www.heise.de:8080/singleParam/123"), Test(Route.MultiParam("user-name", 999), "https://www.heise.de:8080/multiParam/user-name/999"), - Test(Route.MultiParamQuery("user-name", 999)(123, "red"), "https://www.heise.de:8080/multiParamQuery/user-name/999?page=123&filter=red"), - Test(Route.MultiParamQueryOptional("user-name", 999)(123, Some("red")), "https://www.heise.de:8080/multiParamQueryOptional/user-name/999?page=123&filter=red"), - Test(Route.MultiParamQueryOptional("user-name", 999)(123, None), "https://www.heise.de:8080/multiParamQueryOptional/user-name/999?page=123"), + Test( + Route.MultiParamQuery("user-name", 999)(123, "red"), + "https://www.heise.de:8080/multiParamQuery/user-name/999?page=123&filter=red" + ), + Test( + Route.MultiParamQueryOptional("user-name", 999)(123, Some("red")), + "https://www.heise.de:8080/multiParamQueryOptional/user-name/999?page=123&filter=red" + ), + Test( + Route.MultiParamQueryOptional("user-name", 999)(123, None), + "https://www.heise.de:8080/multiParamQueryOptional/user-name/999?page=123" + ) ) From 4e17576f639740c42d95128f614ab8e941abe764 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 14 Jan 2025 17:27:14 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.8.4' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..bcd3b34 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.8.4 +573644dedf67cec28587961e9bd4e8441fde3006