Skip to content

Commit

Permalink
fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrapyre committed May 6, 2024
1 parent 83c8fb9 commit 991dabb
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package zio.schema.codec

object JsonPlatformSpecific {
@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))

@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificEncoderTests = Seq.empty
@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))

@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificDecoderTests = Seq.empty
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import zio.test.{ Gen, check }

object JsonPlatformSpecific {

@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))
@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificEncoderTests = Seq(
test("Currency") {
assertEncodesJson(
Expand All @@ -18,9 +16,7 @@ object JsonPlatformSpecific {
}
)

@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))
@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificDecoderTests = Seq(
test("Currency") {
check(Gen.currency)(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package zio.schema.codec

object JsonPlatformSpecific {
@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))

@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificEncoderTests = Seq.empty
@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))

@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificDecoderTests = Seq.empty
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package zio.schema.codec

object ProtobufPlatformSpecific {
@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))

@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificEncodeAndDecode = Seq.empty
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import zio.test.{ Gen, assert, check }

object ProtobufPlatformSpecific {

@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))
@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificEncodeAndDecode = Seq(
test("currencies") {
check(Gen.currency) { value =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package zio.schema.codec

object ProtobufPlatformSpecific {
@SuppressWarnings(Array(
"scalafix:ExplicitResultTypes"
))

@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
val platformSpecificEncodeAndDecode = Seq.empty
}
5 changes: 2 additions & 3 deletions zio-schema/jvm/src/main/scala/zio/schema/StandardType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,13 @@ object StandardType {

implicit object CurrencyType extends StandardType[java.util.Currency] {
override def tag: String = Tags.CURRENCY
override def defaultValue: Either[String, java.util.Currency] = {
override def defaultValue: Either[String, java.util.Currency] =
try {
Right(java.util.Currency.getInstance(java.util.Locale.getDefault()))
} catch {
case _: NullPointerException => throw new Exception("Could not get default currency. Default locale was null.")
case ex => throw new Exception(s"Could not get default currency. ${ex.getMessage}")
case ex: Throwable => throw new Exception(s"Could not get default currency. ${ex.getMessage}")
}
}

override def compare(x: java.util.Currency, y: java.util.Currency): Int =
x.getCurrencyCode.compareTo(y.getCurrencyCode)
Expand Down

0 comments on commit 991dabb

Please sign in to comment.