diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..f69ecdf98 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.7.9 +8f37c295e78493db6691365005e50929cda49eaa diff --git a/.scalafmt.conf b/.scalafmt.conf index 646389059..c3b1cf612 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.7.2" +version = "3.7.9" runner.dialect = scala213 maxColumn = 120 align.preset = most diff --git a/magnolia/shared/src/test/scala-dotty/zio/config/magnolia/AutomaticConfigSpec.scala b/magnolia/shared/src/test/scala-dotty/zio/config/magnolia/AutomaticConfigSpec.scala index a5efaae76..72d920b7e 100644 --- a/magnolia/shared/src/test/scala-dotty/zio/config/magnolia/AutomaticConfigSpec.scala +++ b/magnolia/shared/src/test/scala-dotty/zio/config/magnolia/AutomaticConfigSpec.scala @@ -67,10 +67,10 @@ object AutomaticConfigTestUtils { private val genCurrency: Gen[Any, Currency] = Gen.double(10.0, 20.0).map(Currency.apply) private val genPrice: Gen[Any, Price] = Gen.oneOf(genPriceDescription, genCurrency) - private val genToken = Gen.const(Token("someToken")) - private val genPassword = Gen.const(Password("some passeword")) + private val genToken = Gen.const(Token("someToken")) + private val genPassword = Gen.const(Password("some passeword")) private val genInstanceProfile = Gen.const(InstanceProfile) - private val genCredentials = Gen.oneOf(genToken, genPassword, genInstanceProfile) + private val genCredentials = Gen.oneOf(genToken, genPassword, genInstanceProfile) private val genDbUrl = Gen.const(DbUrl("dburl")) @@ -112,9 +112,9 @@ object AutomaticConfigTestUtils { ) ++ (aws.security match { case Password(password) => Map("aws.security.type" -> "Password", "aws.security.value" -> password) - case Token(token) => + case Token(token) => Map("aws.security.type" -> "Token", "aws.security.value" -> token) - case InstanceProfile => + case InstanceProfile => Map("aws.security.type" -> "InstanceProfile") }) ++ amount.map(double => ("amount", double.toString)).toList } yield (default, anotherDefault) match { diff --git a/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigErrorsSpec.scala b/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigErrorsSpec.scala index 74a992f17..4388b0488 100644 --- a/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigErrorsSpec.scala +++ b/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigErrorsSpec.scala @@ -95,7 +95,7 @@ object TypesafeConfigErrorsSpec extends ZIOSpecDefault { // assert(notWellFormedConfigResult.isLeft)(Assertion.isTrue) // }, test("A variant error case with typesafe HOCON config and a manual description") { - val configNestedManual = { + val configNestedManual = { val accountConfig = (string("region") zip string("accountId")).to[Account] diff --git a/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigListTest.scala b/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigListTest.scala index 65f5e8bb9..0bb041c9f 100644 --- a/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigListTest.scala +++ b/typesafe-magnolia-tests/shared/src/test/scala/zio/config/typesafe/TypesafeConfigListTest.scala @@ -124,17 +124,17 @@ object TypesafeConfigListTest extends ZIOSpecDefault { |""".stripMargin final case class Details3( - ci: String, - vi: Either[Int, Either[Long, Either[Double, Either[Float, String]]]], - lst: List[Int], - vvv: Option[List[Int]] - ) + ci: String, + vi: Either[Int, Either[Long, Either[Double, Either[Float, String]]]], + lst: List[Int], + vvv: Option[List[Int]] + ) final case class Details2(hi: String, bi: String, r: List[Details3]) final case class Details1( - table: String, - columns: List[String], - extraDetails: List[Details2] - ) + table: String, + columns: List[String], + extraDetails: List[Details2] + ) final case class ExportDetails(exportDetails: List[Details1], database: Database) final case class Port(va: String) final case class Database(port: Port) @@ -147,85 +147,106 @@ object TypesafeConfigListTest extends ZIOSpecDefault { val expectedResult = ExportDetails( - exportDetails = List(Details1( - table = "some_name", - columns = List("a", "b", "c", "d"), - extraDetails = List(Details2( - hi = "di", - bi = "ci", - r = List(Details3( - ci = "ki", - vi = Right(value = Right(value = Right(value = Right(value = "bi")))), - lst = List(1, 1, 1), - vvv = Some(Nil) - ), Details3( - ci = "ki", - vi = Right(value = Right(value = Left(value = 1.0882121))), - lst = List(1, 2, 1), - vvv = None - ), Details3( - ci = "ki", - vi = Left(value = 3), - lst = List(1, 3, 5), - vvv = Some(List(1, 2, 3)) - )) - ), Details2( - hi = "di", - bi = "ci", - r = List(Details3( - ci = "ki", - vi = Right(value = Right(value = Right(value = Right(value = "bi")))), - lst = List(1, 1, 1), - vvv = Some(Nil) - ), Details3( - ci = "ki", - vi = Right(value = Right(value = Left(value = 1.0882121))), - lst = List(1, 2, 1), - vvv = None - ), Details3( - ci = "ki", - vi = Left(value = 3), - lst = List(1, 3, 5), - vvv = Some(List(1, 2, 3)) - )) - ), Details2( - hi = "di", - bi = "ci", - r = Nil - )) - ), Details1( - table = "some_name1", - columns = Nil, - extraDetails = List(Details2( - hi = "di", - bi = "ci", - r = Nil - ), Details2( - hi = "di", - bi = "ci", - r = Nil - ), Details2( - hi = "di", - bi = "ci", - r = Nil - )) - ), Details1( - table = "some_name1", - columns = Nil, - extraDetails = Nil - ), Details1( - table = "some_name2", - columns = Nil, - extraDetails = Nil - ), Details1( - table = "some_name2", - columns = Nil, - extraDetails = Nil - )), + exportDetails = List( + Details1( + table = "some_name", + columns = List("a", "b", "c", "d"), + extraDetails = List( + Details2( + hi = "di", + bi = "ci", + r = List( + Details3( + ci = "ki", + vi = Right(value = Right(value = Right(value = Right(value = "bi")))), + lst = List(1, 1, 1), + vvv = Some(Nil) + ), + Details3( + ci = "ki", + vi = Right(value = Right(value = Left(value = 1.0882121))), + lst = List(1, 2, 1), + vvv = None + ), + Details3( + ci = "ki", + vi = Left(value = 3), + lst = List(1, 3, 5), + vvv = Some(List(1, 2, 3)) + ) + ) + ), + Details2( + hi = "di", + bi = "ci", + r = List( + Details3( + ci = "ki", + vi = Right(value = Right(value = Right(value = Right(value = "bi")))), + lst = List(1, 1, 1), + vvv = Some(Nil) + ), + Details3( + ci = "ki", + vi = Right(value = Right(value = Left(value = 1.0882121))), + lst = List(1, 2, 1), + vvv = None + ), + Details3( + ci = "ki", + vi = Left(value = 3), + lst = List(1, 3, 5), + vvv = Some(List(1, 2, 3)) + ) + ) + ), + Details2( + hi = "di", + bi = "ci", + r = Nil + ) + ) + ), + Details1( + table = "some_name1", + columns = Nil, + extraDetails = List( + Details2( + hi = "di", + bi = "ci", + r = Nil + ), + Details2( + hi = "di", + bi = "ci", + r = Nil + ), + Details2( + hi = "di", + bi = "ci", + r = Nil + ) + ) + ), + Details1( + table = "some_name1", + columns = Nil, + extraDetails = Nil + ), + Details1( + table = "some_name2", + columns = Nil, + extraDetails = Nil + ), + Details1( + table = "some_name2", + columns = Nil, + extraDetails = Nil + ) + ), database = Database(port = Port(va = "ba")) ) - assertZIO(zioConfigWithKeysInKebabResult)(equalTo(expectedResult)) } )