From 0a40e7fe8aa13d154fbf3b20e4959d69bbf7a823 Mon Sep 17 00:00:00 2001 From: Niklas Klein Date: Sun, 29 Sep 2024 14:08:57 +0200 Subject: [PATCH] Apply scalafix --- .../src/main/scala/io/taig/enumeration/ext/circe.scala | 4 +++- .../test/scala/io/taig/enumeration/ext/CirceTest.scala | 7 +++++-- .../src/main/scala/io/taig/enumeration/ext/ciris.scala | 4 ++-- .../io/taig/enumeration/ext/EnumerationValues.scala | 3 ++- .../src/main/scala/io/taig/enumeration/ext/Mapping.scala | 9 +++++---- .../io/taig/enumeration/ext/EnumerationValuesTest.scala | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/circe/src/main/scala/io/taig/enumeration/ext/circe.scala b/modules/circe/src/main/scala/io/taig/enumeration/ext/circe.scala index 239d041..3315579 100644 --- a/modules/circe/src/main/scala/io/taig/enumeration/ext/circe.scala +++ b/modules/circe/src/main/scala/io/taig/enumeration/ext/circe.scala @@ -3,7 +3,9 @@ package io.taig.enumeration.ext import cats.Order import cats.Show import cats.syntax.all.* -import io.circe.{Codec, Decoder, Encoder} +import io.circe.Codec +import io.circe.Decoder +import io.circe.Encoder trait circe: given decodeMapping[A, B](using mapping: Mapping[A, B], decoder: Decoder[B])(using Show[B]): Decoder[A] = diff --git a/modules/circe/src/test/scala/io/taig/enumeration/ext/CirceTest.scala b/modules/circe/src/test/scala/io/taig/enumeration/ext/CirceTest.scala index 784a516..f96e36b 100644 --- a/modules/circe/src/test/scala/io/taig/enumeration/ext/CirceTest.scala +++ b/modules/circe/src/test/scala/io/taig/enumeration/ext/CirceTest.scala @@ -1,8 +1,11 @@ package io.taig.enumeration.ext -import io.taig.enumeration.ext.circe.given +import io.circe.Decoder +import io.circe.DecodingFailure +import io.circe.Encoder +import io.circe.Json import io.taig.enumeration.ext.circe.* -import io.circe.{Decoder, DecodingFailure, Encoder, Json} +import io.taig.enumeration.ext.circe.given import munit.FunSuite final class CirceTest extends FunSuite: diff --git a/modules/ciris/src/main/scala/io/taig/enumeration/ext/ciris.scala b/modules/ciris/src/main/scala/io/taig/enumeration/ext/ciris.scala index d9451ac..196c796 100644 --- a/modules/ciris/src/main/scala/io/taig/enumeration/ext/ciris.scala +++ b/modules/ciris/src/main/scala/io/taig/enumeration/ext/ciris.scala @@ -1,9 +1,9 @@ package io.taig.enumeration.ext -import cats.syntax.all.* -import cats.Show import _root_.ciris.ConfigDecoder +import cats.Show import cats.kernel.Order +import cats.syntax.all.* trait ciris: given conficDecoder[A, B, C: Show](using mapping: Mapping[B, C], decoder: ConfigDecoder[A, C]): ConfigDecoder[A, B] = diff --git a/modules/core/src/main/scala/io/taig/enumeration/ext/EnumerationValues.scala b/modules/core/src/main/scala/io/taig/enumeration/ext/EnumerationValues.scala index be0acdb..6924f90 100644 --- a/modules/core/src/main/scala/io/taig/enumeration/ext/EnumerationValues.scala +++ b/modules/core/src/main/scala/io/taig/enumeration/ext/EnumerationValues.scala @@ -1,8 +1,9 @@ package io.taig.enumeration.ext -import scala.deriving.Mirror import cats.data.NonEmptyList +import scala.deriving.Mirror + /** Derive all singelton values of a (nested) enumeration which may consist of Scala 3's `enum` or sealed traits and * classes */ diff --git a/modules/core/src/main/scala/io/taig/enumeration/ext/Mapping.scala b/modules/core/src/main/scala/io/taig/enumeration/ext/Mapping.scala index cbd2898..b1a2c5b 100644 --- a/modules/core/src/main/scala/io/taig/enumeration/ext/Mapping.scala +++ b/modules/core/src/main/scala/io/taig/enumeration/ext/Mapping.scala @@ -1,12 +1,13 @@ package io.taig.enumeration.ext -import cats.{Eq, Inject} -import cats.syntax.all.* +import cats.Eq +import cats.Inject +import cats.Order +import cats.data.NonEmptyList import cats.data.NonEmptyMap +import cats.syntax.all.* import scala.annotation.targetName -import cats.Order -import cats.data.NonEmptyList sealed abstract class Mapping[A, B] extends Inject[A, B]: def values: NonEmptyList[A] diff --git a/modules/core/src/test/scala/io/taig/enumeration/ext/EnumerationValuesTest.scala b/modules/core/src/test/scala/io/taig/enumeration/ext/EnumerationValuesTest.scala index bc4c77e..084c73b 100644 --- a/modules/core/src/test/scala/io/taig/enumeration/ext/EnumerationValuesTest.scala +++ b/modules/core/src/test/scala/io/taig/enumeration/ext/EnumerationValuesTest.scala @@ -1,7 +1,7 @@ package io.taig.enumeration.ext -import munit.FunSuite import cats.data.NonEmptyList +import munit.FunSuite final class EnumerationValuesTest extends FunSuite: test("enum"):