Skip to content
Closed
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.9.7
57db10a7468db8214022fc1337eb557d9f2ac0a9
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=3.7.17
version=3.9.7
runner.dialect=scala213source3
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import scalapb.compiler.Version.scalapbVersion

scalaVersion := "2.13.12"

crossScalaVersions := Seq("2.12.18", "2.13.16", "3.3.3")
crossScalaVersions := Seq("2.12.20", "2.13.16", "3.3.3")

ThisBuild / organization := "com.thesamet.scalapb"

Expand All @@ -22,7 +22,7 @@ val protobufJava = "com.google.protobuf" % "protobuf-java" % "3.25.8"
libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapbVersion,
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapbVersion % "protobuf,test",
"org.scalatest" %% "scalatest" % "3.2.17" % "test",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"org.scalatestplus" %% "scalacheck-1-17" % "3.2.17.0" % "test",
"com.google.protobuf" % "protobuf-java-util" % protobufJava.revision % "test",
protobufJava % "protobuf",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.7
sbt.version=1.9.9
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.18"

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.4")

addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
26 changes: 13 additions & 13 deletions src/main/scala/scalapb/json4s/JsonFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class Printer private (config: Printer.PrinterConfig) {
case PInt(v) => v.toString
case PLong(v) => v.toString
case PString(v) => v
case v =>
case v =>
throw new JsonFormatException(s"Unexpected value for key: $v")
}
val value = if (valueDescriptor.protoType.isTypeMessage) {
Expand Down Expand Up @@ -396,7 +396,7 @@ class Printer private (config: Printer.PrinterConfig) {
m.companion.asInstanceOf[GeneratedMessageCompanion[A]]
) match {
case Some(f) => f(this, m)
case None =>
case None =>
val b = List.newBuilder[JField]
val descriptor = m.companion.scalaDescriptor
b.sizeHint(descriptor.fields.size)
Expand Down Expand Up @@ -450,7 +450,7 @@ class Printer private (config: Printer.PrinterConfig) {
case PEnum(e) =>
config.formatRegistry.getEnumWriter(e.containingEnum) match {
case Some(writer) => writer(this, e)
case None =>
case None =>
if (config.isFormattingEnumsAsNumber || e.isUnrecognized)
JInt(e.number)
else JString(e.name)
Expand All @@ -460,11 +460,11 @@ class Printer private (config: Printer.PrinterConfig) {
case PInt(v) => JInt(v)
case PLong(v) => formatLong(v, fd.protoType, formattingLongAsNumber)
case PDouble(v) => JDouble(v)
case PFloat(v) =>
case PFloat(v) =>
if (!v.isNaN && !v.isInfinite) JDecimal(BigDecimal.decimal(v))
else JDouble(v)
case PBoolean(v) => JBool(v)
case PString(v) => JString(v)
case PBoolean(v) => JBool(v)
case PString(v) => JString(v)
case PByteString(v) =>
JString(Base64Variants.getDefaultVariant.encode(v.toByteArray))
case _: PMessage | PRepeated(_) | PEmpty =>
Expand Down Expand Up @@ -581,7 +581,7 @@ class Parser private (config: Parser.ParserConfig) {
case ScalaType.Int => PInt(java.lang.Integer.valueOf(key))
case ScalaType.Long => PLong(java.lang.Long.valueOf(key))
case ScalaType.String => PString(key)
case _ =>
case _ =>
throw new RuntimeException(
s"Unsupported type for key for ${fd.name}"
)
Expand Down Expand Up @@ -618,7 +618,7 @@ class Parser private (config: Parser.ParserConfig) {
cmp.asInstanceOf[GeneratedMessageCompanion[GeneratedMessage]]
) match {
case Some(p) => p(this, value).toPMessage
case None =>
case None =>
value match {
case JObject(fields) =>
val usedOneofs = mutable.Set[OneofDescriptor]()
Expand Down Expand Up @@ -987,7 +987,7 @@ object JsonFormat {
case (Type.TYPE_BOOL, JString("true")) => PBoolean(true)
case (Type.TYPE_BOOL, JString("false")) => PBoolean(false)
case (Type.TYPE_STRING, JString(s)) => PString(s)
case (Type.TYPE_BYTES, JString(s)) =>
case (Type.TYPE_BYTES, JString(s)) =>
PByteString(
ByteString.copyFrom(Base64Variants.getDefaultVariant.decode(s))
)
Expand Down Expand Up @@ -1072,7 +1072,7 @@ object JsonFormat {
case "NaN" => PDouble(Double.NaN)
case "Infinity" => PDouble(Double.PositiveInfinity)
case "-Infinity" => PDouble(Double.NegativeInfinity)
case v =>
case v =>
try {
val bd = new java.math.BigDecimal(v)
if (bd.compareTo(MAX_DOUBLE) > 0 || bd.compareTo(MIN_DOUBLE) < 0) {
Expand All @@ -1081,7 +1081,7 @@ object JsonFormat {
PDouble(bd.doubleValue)
} catch {
case e: JsonFormatException => throw e
case e: Exception =>
case e: Exception =>
throw new JsonFormatException("Not a double value: " + v)
}
}
Expand All @@ -1091,7 +1091,7 @@ object JsonFormat {
case "NaN" => PFloat(Float.NaN)
case "Infinity" => PFloat(Float.PositiveInfinity)
case "-Infinity" => PFloat(Float.NegativeInfinity)
case v =>
case v =>
try {
val value = java.lang.Double.parseDouble(v)
if (
Expand All @@ -1103,7 +1103,7 @@ object JsonFormat {
PFloat(value.toFloat)
} catch {
case e: JsonFormatException => throw e
case e: Exception =>
case e: Exception =>
throw new JsonFormatException("Not a float value: " + v)
}
}
Expand Down