Skip to content

Commit

Permalink
Merge pull request #1120 from scala-steward/update/scalafmt-core-3.8.3
Browse files Browse the repository at this point in the history
Update scalafmt-core to 3.8.3
  • Loading branch information
sh0hei authored Jul 30, 2024
2 parents 65a6c5e + 85da2b1 commit 070ea66
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 45 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ c7fee907e9119bbe1dc3cdcbf4b95073219b76da

# Scala Steward: Reformat with scalafmt 3.7.0
ff6150276488d99b50b99f850885927e8da91b9d

# Scala Steward: Reformat with scalafmt 3.8.3
e4af65308dbd509e021f2b50c31d6bc5fda41d4a
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.8.2
version = 3.8.3

runner.dialect = scala213

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
47 changes: 15 additions & 32 deletions modules/core/src/main/scala/sangria/schema/SchemaComparator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
Expand All @@ -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
)
Expand Down Expand Up @@ -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
)
Expand All @@ -952,17 +946,15 @@ 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(
tpe: InputObjectType[_],
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
)
Expand All @@ -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
)

Expand All @@ -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
)
Expand All @@ -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
)

Expand All @@ -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
)
Expand All @@ -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
)

Expand Down Expand Up @@ -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
)

Expand All @@ -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
Expand All @@ -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
)

Expand Down
8 changes: 4 additions & 4 deletions modules/core/src/test/scala/sangria/util/CatsSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand All @@ -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))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]) =
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 070ea66

Please sign in to comment.