diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 465ca02505..a500e78c50 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,5 @@ # Scala Steward: Reformat with scalafmt 3.7.14 d389b41fac321833b103ba17f86fcb3e209f5596 + +# Scala Steward: Reformat with scalafmt 3.9.5 +94def2c6d78085fa01a3d79fe3f499e60fcc0915 diff --git a/.scalafmt.conf b/.scalafmt.conf index 7f160698ef..a9790ad99f 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version="3.7.17" +version="3.9.5" project.git = true diff --git a/modules/java-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala b/modules/java-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala index 19c0f5a2ab..7840292cac 100644 --- a/modules/java-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala +++ b/modules/java-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala @@ -131,12 +131,10 @@ class JacksonHelpersTest extends AnyFreeSpec with Matchers { intercept[NoSuchElementException](discriminatorExpression("3424.3123", "number", Some("foobaz")).value) } - "random types" in { + "random types" in intercept[NoSuchElementException](discriminatorExpression("asdsd", "foobaz").value) - } - "non-matching string types" in { + "non-matching string types" in intercept[NoSuchElementException](discriminatorExpression("asdasd", "integer", Some("int32")).value) - } } } diff --git a/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonBuilderParamTest.scala b/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonBuilderParamTest.scala index 7b2f126f87..4bd01e6c6d 100644 --- a/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonBuilderParamTest.scala +++ b/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonBuilderParamTest.scala @@ -6,12 +6,11 @@ import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers class JacksonBuilderParamTest extends AnyFreeSpec with Matchers { - "POJO builders should not accept nulls for required params" in { + "POJO builders should not accept nulls for required params" in assertThrows[NullPointerException] { new Pet.Builder(null: String) .build() } - } "POJO builders should accept nulls for the value variant for optional params" in { val pet = new Pet.Builder("fluffy") @@ -20,11 +19,10 @@ class JacksonBuilderParamTest extends AnyFreeSpec with Matchers { pet.getCategory shouldBe Optional.empty } - "POJO builders should not accept nulls for the Optional<> variant for optional params" in { + "POJO builders should not accept nulls for the Optional<> variant for optional params" in assertThrows[NullPointerException] { new Pet.Builder("fluffy") .withCategory(null: Optional[Category]) .build() } - } } diff --git a/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonNestedTest.scala b/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonNestedTest.scala index a7b4bbe8fc..36bea0a9a1 100644 --- a/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonNestedTest.scala +++ b/modules/sample-dropwizard/src/test/scala/core/Jackson/JacksonNestedTest.scala @@ -7,13 +7,12 @@ import polymorphismNested.client.dropwizard.definitions.{ A, B, C, TestResponse class JacksonNestedTest extends AnyFreeSpec with Matchers { "Jackson nested schemas" - { - "Should have the nested objects in the right place" in { + "Should have the nested objects in the right place" in new TestResponse.Builder() .withEnum1(A.Enum1.B) .withEnum2(B.Enum2.D) .withObj(new C.Obj.Builder().withValue("foo").build()) .build() - } "Should have nested classes as public static members" in { classOf[C.Obj].getModifiers & Modifier.PUBLIC mustBe Modifier.PUBLIC diff --git a/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonBuilderParamTest.scala b/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonBuilderParamTest.scala index 138eca9cda..203f27f73a 100644 --- a/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonBuilderParamTest.scala +++ b/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonBuilderParamTest.scala @@ -6,12 +6,11 @@ import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers class JacksonBuilderParamTest extends AnyFreeSpec with Matchers { - "POJO builders should not accept nulls for required params" in { + "POJO builders should not accept nulls for required params" in assertThrows[NullPointerException] { new Pet.Builder(null: String) .build() } - } "POJO builders should accept nulls for the value variant for optional params" in { val pet = new Pet.Builder("fluffy") @@ -20,11 +19,10 @@ class JacksonBuilderParamTest extends AnyFreeSpec with Matchers { pet.getCategory shouldBe VavrOption.none } - "POJO builders should not accept nulls for the Optional<> variant for optional params" in { + "POJO builders should not accept nulls for the Optional<> variant for optional params" in assertThrows[NullPointerException] { new Pet.Builder("fluffy") .withCategory(null: VavrOption[Category]) .build() } - } } diff --git a/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonNestedTest.scala b/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonNestedTest.scala index 4c40bb94d5..28e874ece1 100644 --- a/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonNestedTest.scala +++ b/modules/sample-dropwizardVavr/src/test/scala/core/JacksonVavr/JacksonNestedTest.scala @@ -8,13 +8,12 @@ import polymorphismNested.client.dropwizardVavr.definitions.{ A, B, C, TestRespo class JacksonNestedTest extends AnyFreeSpec with Matchers { "Jackson nested schemas" - { - "Should have the nested objects in the right place" in { + "Should have the nested objects in the right place" in new TestResponse.Builder() .withEnum1(A.Enum1.B) .withEnum2(B.Enum2.D) .withObj(new C.Obj.Builder().withValue("foo").build()) .build() - } "Should have nested classes as public static members" in { classOf[C.Obj].getModifiers & Modifier.PUBLIC mustBe Modifier.PUBLIC diff --git a/modules/sample-springMvc/src/test/scala/examples/server/springMvc/pet/BaselineSpecs.scala b/modules/sample-springMvc/src/test/scala/examples/server/springMvc/pet/BaselineSpecs.scala index 70494a69d5..1efe3b58f1 100644 --- a/modules/sample-springMvc/src/test/scala/examples/server/springMvc/pet/BaselineSpecs.scala +++ b/modules/sample-springMvc/src/test/scala/examples/server/springMvc/pet/BaselineSpecs.scala @@ -69,14 +69,13 @@ class BaselineSpecs extends AnyFreeSpec with Matchers with BeforeAndAfterAll wit assertTrue(content.contains("mouse")) } - "required param missing" in { + "required param missing" in mvc .perform( get("/v2/pet/findByStatus") .accept(MediaType.APPLICATION_JSON) ) .andExpect(status.is4xxClientError()) - } "query params (list)" in { val entityBody = new util.ArrayList[Pet]() diff --git a/modules/scala-akka-http/src/test/scala/core/issues/Issue43.scala b/modules/scala-akka-http/src/test/scala/core/issues/Issue43.scala index 5296085c07..dfaa8993e6 100644 --- a/modules/scala-akka-http/src/test/scala/core/issues/Issue43.scala +++ b/modules/scala-akka-http/src/test/scala/core/issues/Issue43.scala @@ -269,8 +269,8 @@ class Issue43 extends AnyFunSpec with Matchers with SwaggerSpecRunner { val ( ProtocolDefinitions( ClassDefinition(namePersianCat, tpePersianCat, fullTypePersioanCat, clsPersianCat, staticDefnsPersianCat, persianCatParents) - :: ClassDefinition(nameDog, tpeDog, fullTypeDog, clsDog, staticDefnsDog, dogParents) - :: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil, + :: ClassDefinition(nameDog, tpeDog, fullTypeDog, clsDog, staticDefnsDog, dogParents) + :: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil, _, _, _, @@ -466,8 +466,8 @@ class Issue43 extends AnyFunSpec with Matchers with SwaggerSpecRunner { val ( ProtocolDefinitions( ClassDefinition(nameDog, tpeDog, fullTypeDog, clsDog, staticDefnsDog, dogParents) - :: ClassDefinition(namePersianCat, tpePersianCat, fullTypePersianCat, clsPersianCat, staticDefnsPersianCat, persianCatParents) - :: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil, + :: ClassDefinition(namePersianCat, tpePersianCat, fullTypePersianCat, clsPersianCat, staticDefnsPersianCat, persianCatParents) + :: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil, _, _, _, @@ -566,7 +566,7 @@ class Issue43 extends AnyFunSpec with Matchers with SwaggerSpecRunner { val ( ProtocolDefinitions( ClassDefinition(nameCat, tpeCat, fullTypeCat, clsCat, staticDefnsCat, catParents) - :: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameMammal, tpeMammal, fullTypeMammal, trtMammal, staticDefnsMammal) :: Nil, + :: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameMammal, tpeMammal, fullTypeMammal, trtMammal, staticDefnsMammal) :: Nil, _, _, _, diff --git a/modules/scala-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala b/modules/scala-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala index 81535a09e0..785d56055b 100644 --- a/modules/scala-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala +++ b/modules/scala-support/src/test/scala/tests/generators/helpers/JacksonHelpersTest.scala @@ -84,12 +84,10 @@ class JacksonHelpersTest extends AnyFreeSpec with Matchers { intercept[NoSuchElementException](discriminatorExpression("3424.3123", "number", Some("foobaz")).value) } - "random types" in { + "random types" in intercept[NoSuchElementException](discriminatorExpression("asdsd", "foobaz").value) - } - "non-matching string types" in { + "non-matching string types" in intercept[NoSuchElementException](discriminatorExpression("asdasd", "integer", Some("int32")).value) - } } }