From ad1be74718a026e3ce093cd77b7149e8447effb8 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 30 Jul 2024 01:10:22 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.8.3 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index ff7f2f1b..e29a37f2 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.2 +version = 3.8.3 runner.dialect = scala213 From e4af65308dbd509e021f2b50c31d6bc5fda41d4a Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 30 Jul 2024 01:11:19 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.8.3 Executed command: scalafmt --non-interactive --- .../sangria/execution/ExecutionError.scala | 3 +- .../sangria/schema/SchemaComparator.scala | 47 ++++++------------- .../test/scala/sangria/util/CatsSupport.scala | 8 ++-- .../macros/derive/DeriveObjectTypeMacro.scala | 4 +- .../derive/DeriveObjectTypeMacroSpec.scala | 6 +-- 5 files changed, 24 insertions(+), 44 deletions(-) diff --git a/modules/core/src/main/scala/sangria/execution/ExecutionError.scala b/modules/core/src/main/scala/sangria/execution/ExecutionError.scala index 9813e51b..d87a522b 100644 --- a/modules/core/src/main/scala/sangria/execution/ExecutionError.scala +++ b/modules/core/src/main/scala/sangria/execution/ExecutionError.scala @@ -63,8 +63,7 @@ case class UndefinedConcreteTypeError( sourceMapper: Option[SourceMapper] = None, locations: List[AstLocation] = Nil) extends InternalExecutionError( - s"Can't find appropriate subtype of ${UndefinedConcreteTypeError.renderAbstractType( - abstractType)} type '${abstractType.name}' for value of class '${UndefinedConcreteTypeError + s"Can't find appropriate subtype of ${UndefinedConcreteTypeError.renderAbstractType(abstractType)} type '${abstractType.name}' for value of class '${UndefinedConcreteTypeError .renderValueClass(value)}' at path '$path'. Possible types: ${UndefinedConcreteTypeError .renderPossibleTypes(possibleTypes)}. Got value: $value.") diff --git a/modules/core/src/main/scala/sangria/schema/SchemaComparator.scala b/modules/core/src/main/scala/sangria/schema/SchemaComparator.scala index ac6b8b84..068ace7d 100644 --- a/modules/core/src/main/scala/sangria/schema/SchemaComparator.scala +++ b/modules/core/src/main/scala/sangria/schema/SchemaComparator.scala @@ -841,9 +841,7 @@ object SchemaChange { oldDefault: Option[ast.Value], newDefault: Option[ast.Value]) extends AbstractChange( - s"`${tpe.name}.${field.name}` default value changed from ${oldDefault.fold("none")(d => - s"`${QueryRenderer.renderCompact(d)}`")} to ${newDefault.fold("none")(d => - s"`${QueryRenderer.renderCompact(d)}`")}", + s"`${tpe.name}.${field.name}` default value changed from ${oldDefault.fold("none")(d => s"`${QueryRenderer.renderCompact(d)}`")} to ${newDefault.fold("none")(d => s"`${QueryRenderer.renderCompact(d)}`")}", breakingChange = false ) with TypeChange @@ -856,8 +854,7 @@ object SchemaChange { newDefault: Option[ast.Value]) extends AbstractChange( s"`${tpe.name}.${field.name}(${argument.name})` default value changed from ${oldDefault - .fold("none")(d => s"`${QueryRenderer.renderCompact(d)}`")} to ${newDefault.fold( - "none")(d => s"`${QueryRenderer.renderCompact(d)}`")}", + .fold("none")(d => s"`${QueryRenderer.renderCompact(d)}`")} to ${newDefault.fold("none")(d => s"`${QueryRenderer.renderCompact(d)}`")}", breakingChange = false, dangerousChange = true ) @@ -869,9 +866,7 @@ object SchemaChange { oldDefault: Option[ast.Value], newDefault: Option[ast.Value]) extends AbstractChange( - s"`${directive.name}(${argument.name})` default value changed from ${oldDefault.fold( - "none")(d => "`" + QueryRenderer.renderCompact(d) + "`")} to ${newDefault.fold("none")( - d => "`" + QueryRenderer.renderCompact(d) + "`")}", + s"`${directive.name}(${argument.name})` default value changed from ${oldDefault.fold("none")(d => "`" + QueryRenderer.renderCompact(d) + "`")} to ${newDefault.fold("none")(d => "`" + QueryRenderer.renderCompact(d) + "`")}", breakingChange = false, dangerousChange = true ) @@ -941,8 +936,7 @@ object SchemaChange { value: EnumValue[_], directive: ast.Directive) extends AbstractAstDirectiveAdded( - s"Directive `${QueryRenderer.renderCompact( - directive)}` added on an enum value `${tpe.name}.${value.name}`", + s"Directive `${QueryRenderer.renderCompact(directive)}` added on an enum value `${tpe.name}.${value.name}`", DirectiveLocation.EnumValue, breakingChange = false ) @@ -952,8 +946,7 @@ object SchemaChange { value: EnumValue[_], directive: ast.Directive) extends AbstractAstDirectiveRemoved( - s"Directive `${QueryRenderer.renderCompact( - directive)}` removed from a enum value `${tpe.name}.${value.name}`", + s"Directive `${QueryRenderer.renderCompact(directive)}` removed from a enum value `${tpe.name}.${value.name}`", DirectiveLocation.EnumValue) case class InputFieldAstDirectiveAdded( @@ -961,8 +954,7 @@ object SchemaChange { field: InputField[_], directive: ast.Directive) extends AbstractAstDirectiveAdded( - s"Directive `${QueryRenderer.renderCompact( - directive)}` added on an input field `${tpe.name}.${field.name}`", + s"Directive `${QueryRenderer.renderCompact(directive)}` added on an input field `${tpe.name}.${field.name}`", DirectiveLocation.InputFieldDefinition, breakingChange = false ) @@ -972,8 +964,7 @@ object SchemaChange { field: InputField[_], directive: ast.Directive) extends AbstractAstDirectiveRemoved( - s"Directive `${QueryRenderer.renderCompact( - directive)}` removed from a input field `${tpe.name}.${field.name}`", + s"Directive `${QueryRenderer.renderCompact(directive)}` removed from a input field `${tpe.name}.${field.name}`", DirectiveLocation.InputFieldDefinition ) @@ -982,8 +973,7 @@ object SchemaChange { argument: Argument[_], directive: ast.Directive) extends AbstractAstDirectiveAdded( - s"Directive `${QueryRenderer.renderCompact( - directive)}` added on a directive argument `${dir.name}.${argument.name}`", + s"Directive `${QueryRenderer.renderCompact(directive)}` added on a directive argument `${dir.name}.${argument.name}`", DirectiveLocation.ArgumentDefinition, breakingChange = false ) @@ -993,8 +983,7 @@ object SchemaChange { argument: Argument[_], directive: ast.Directive) extends AbstractAstDirectiveRemoved( - s"Directive `${QueryRenderer.renderCompact( - directive)}` removed from a directive argument `${dir.name}.${argument.name}`", + s"Directive `${QueryRenderer.renderCompact(directive)}` removed from a directive argument `${dir.name}.${argument.name}`", DirectiveLocation.ArgumentDefinition ) @@ -1004,8 +993,7 @@ object SchemaChange { argument: Argument[_], directive: ast.Directive) extends AbstractAstDirectiveAdded( - s"Directive `${QueryRenderer.renderCompact( - directive)}` added on a field argument `${tpe.name}.${field.name}[${argument.name}]`", + s"Directive `${QueryRenderer.renderCompact(directive)}` added on a field argument `${tpe.name}.${field.name}[${argument.name}]`", DirectiveLocation.ArgumentDefinition, breakingChange = false ) @@ -1016,8 +1004,7 @@ object SchemaChange { argument: Argument[_], directive: ast.Directive) extends AbstractAstDirectiveRemoved( - s"Directive `${QueryRenderer.renderCompact( - directive)}` removed from a field argument `${tpe.name}.${field.name}[${argument.name}]`", + s"Directive `${QueryRenderer.renderCompact(directive)}` removed from a field argument `${tpe.name}.${field.name}[${argument.name}]`", DirectiveLocation.ArgumentDefinition ) @@ -1169,8 +1156,7 @@ object SchemaChange { oldFieldType: InputType[_], newFieldType: InputType[_]) extends AbstractChange( - s"`${directive.name}(${argument.name})` type changed from `${SchemaRenderer.renderTypeName( - oldFieldType)}` to `${SchemaRenderer.renderTypeName(newFieldType)}`", + s"`${directive.name}(${argument.name})` type changed from `${SchemaRenderer.renderTypeName(oldFieldType)}` to `${SchemaRenderer.renderTypeName(newFieldType)}`", breaking ) @@ -1181,8 +1167,7 @@ object SchemaChange { oldFieldType: OutputType[_], newFieldType: OutputType[_]) extends AbstractChange( - s"`${tpe.name}.${field.name}` field type changed from `${SchemaRenderer.renderTypeName( - oldFieldType)}` to `${SchemaRenderer.renderTypeName(newFieldType)}`", + s"`${tpe.name}.${field.name}` field type changed from `${SchemaRenderer.renderTypeName(oldFieldType)}` to `${SchemaRenderer.renderTypeName(newFieldType)}`", breaking ) with TypeChange @@ -1191,16 +1176,14 @@ object SchemaChange { oldType: Option[ObjectType[_, _]], newType: Option[ObjectType[_, _]]) extends AbstractChange( - s"Schema mutation type changed from ${oldType.fold("none")(t => - "`" + t.name + "`")} to ${newType.fold("none")(t => "`" + t.name + "`")} type", + s"Schema mutation type changed from ${oldType.fold("none")(t => "`" + t.name + "`")} to ${newType.fold("none")(t => "`" + t.name + "`")} type", oldType.nonEmpty) case class SchemaSubscriptionTypeChanged( oldType: Option[ObjectType[_, _]], newType: Option[ObjectType[_, _]]) extends AbstractChange( - s"Schema subscription type changed from ${oldType.fold("none")(t => - "`" + t.name + "`")} to ${newType.fold("none")(t => "`" + t.name + "`")} type", + s"Schema subscription type changed from ${oldType.fold("none")(t => "`" + t.name + "`")} to ${newType.fold("none")(t => "`" + t.name + "`")} type", oldType.nonEmpty ) diff --git a/modules/core/src/test/scala/sangria/util/CatsSupport.scala b/modules/core/src/test/scala/sangria/util/CatsSupport.scala index 573894af..1fdaee32 100644 --- a/modules/core/src/test/scala/sangria/util/CatsSupport.scala +++ b/modules/core/src/test/scala/sangria/util/CatsSupport.scala @@ -304,8 +304,8 @@ object CatsAssertions extends Matchers { } withLoc.locations.zipWithIndex.foreach { case (pos, idx) => - withClue(s"Violation position mismatch (line: ${locations(idx).line}, column: ${locations( - idx).column}): ${violation.errorMessage}") { + withClue( + s"Violation position mismatch (line: ${locations(idx).line}, column: ${locations(idx).column}): ${violation.errorMessage}") { ErrorLocation(pos.line, pos.column) should be(locations(idx)) } } @@ -330,8 +330,8 @@ object CatsAssertions extends Matchers { } actualLocs.zipWithIndex.foreach { case (pos, idx) => - withClue(s"Violation position mismatch (line: ${locations(idx).line}, column: ${locations( - idx).column}): ${error("message").stringValue}") { + withClue( + s"Violation position mismatch (line: ${locations(idx).line}, column: ${locations(idx).column}): ${error("message").stringValue}") { ErrorLocation(pos("line").intValue, pos("column").intValue) should be(locations(idx)) } } diff --git a/modules/derivation/src/main/scala-3/sangria/macros/derive/DeriveObjectTypeMacro.scala b/modules/derivation/src/main/scala-3/sangria/macros/derive/DeriveObjectTypeMacro.scala index ffeee500..10b32290 100644 --- a/modules/derivation/src/main/scala-3/sangria/macros/derive/DeriveObjectTypeMacro.scala +++ b/modules/derivation/src/main/scala-3/sangria/macros/derive/DeriveObjectTypeMacro.scala @@ -651,8 +651,8 @@ class DeriveObjectTypeMacro(using globalQuotes: Quotes) extends DeriveMacroSuppo if (unknown.isEmpty) Right(MacroIncludeMethods(methods.map(_.valueOrAbort).toSet)) else - Left(PositionByExpr(expr) -> s"Unknown members: ${unknown.mkString( - ", ")}. Known members are: ${known.mkString(", ")}") + Left( + PositionByExpr(expr) -> s"Unknown members: ${unknown.mkString(", ")}. Known members are: ${known.mkString(", ")}") case expr @ '{ ExcludeFields.apply[t, s](${ Varargs(fields) }: _*) } => Right(MacroExcludeFields(fields.map(_.valueOrAbort).toSet, PositionByExpr(expr))) diff --git a/modules/derivation/src/test/scala/sangria/macros/derive/DeriveObjectTypeMacroSpec.scala b/modules/derivation/src/test/scala/sangria/macros/derive/DeriveObjectTypeMacroSpec.scala index b266f229..38beb9c2 100644 --- a/modules/derivation/src/test/scala/sangria/macros/derive/DeriveObjectTypeMacroSpec.scala +++ b/modules/derivation/src/test/scala/sangria/macros/derive/DeriveObjectTypeMacroSpec.scala @@ -543,8 +543,7 @@ class DeriveObjectTypeMacroSpec extends AnyWordSpec with Matchers with FutureRes @GraphQLDefault(ScalaInput.scalaInput(List(Color.Red))) colors: Seq[Color.Value] ) = - s"id = $id, songs = ${songs.mkString(",")}, cc = ${colors.mkString( - ",")}, pet = $pet, ctx = ${ctx.ctx.num}" + s"id = $id, songs = ${songs.mkString(",")}, cc = ${colors.mkString(",")}, pet = $pet, ctx = ${ctx.ctx.num}" @GraphQLField def opt(str: Option[String], color: Option[Color.Value])(pet: Option[Pet]) = @@ -701,8 +700,7 @@ class DeriveObjectTypeMacroSpec extends AnyWordSpec with Matchers with FutureRes def hello( id: Int, songs: Seq[String])(ctx: Context[Ctx, Unit], pet: Pet, colors: Seq[Color.Value]) = - s"id = $id, songs = ${songs.mkString(",")}, cc = ${colors.mkString( - ",")}, pet = $pet, ctx = ${ctx.ctx.num}" + s"id = $id, songs = ${songs.mkString(",")}, cc = ${colors.mkString(",")}, pet = $pet, ctx = ${ctx.ctx.num}" def opt(str: Option[String], color: Option[Color.Value])(pet: Option[Pet]) = s"str = $str, color = $color, pet = $pet" From 85da2b197b004c11b797daec31f0ebfad6edf693 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 30 Jul 2024 01:11:19 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.8.3' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 22e0e67c..87e71c97 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -6,3 +6,6 @@ c7fee907e9119bbe1dc3cdcbf4b95073219b76da # Scala Steward: Reformat with scalafmt 3.7.0 ff6150276488d99b50b99f850885927e8da91b9d + +# Scala Steward: Reformat with scalafmt 3.8.3 +e4af65308dbd509e021f2b50c31d6bc5fda41d4a