diff --git a/.scalafmt.conf b/.scalafmt.conf index d45701aa..785d550d 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "2.7.5" +version = "3.0.0" align.preset = none maxColumn = 120 includeNoParensInSelectChains = false diff --git a/core/src/main/scala-2.12/cats/derived/semiauto.scala b/core/src/main/scala-2.12/cats/derived/semiauto.scala index 84f3ec56..ed8d0a14 100644 --- a/core/src/main/scala-2.12/cats/derived/semiauto.scala +++ b/core/src/main/scala-2.12/cats/derived/semiauto.scala @@ -1,7 +1,7 @@ package cats.derived -/** allows semi automatically derive each instance. The derivation might need help when - * there are fields with a type constructor that comes with instances, e.g. +/** allows semi automatically derive each instance. The derivation might need help when there are fields with a type + * constructor that comes with instances, e.g. * {{{ * scala> case class Bar(a: String) * scala> case class Foo(bars: List[Bar]) @@ -25,9 +25,9 @@ package cats.derived * scala> implicit val fooShow: Show[Foo] = { | * import cats.derived.auto.show._ | * cats.derived.semiauto.show | - * } - * scala> Foo(List(Bar("a"))).show - * res3: String = Foo(bars = List(Bar(a = a))) + * } + * scala> Foo(List(Bar("a"))).show + * res3: String = Foo(bars = List(Bar(a = a))) * }}} */ object semiauto extends SemiAutoInstances diff --git a/core/src/main/scala-2.13/cats/derived/semiauto.scala b/core/src/main/scala-2.13/cats/derived/semiauto.scala index b096422b..4bc63587 100644 --- a/core/src/main/scala-2.13/cats/derived/semiauto.scala +++ b/core/src/main/scala-2.13/cats/derived/semiauto.scala @@ -4,8 +4,8 @@ package derived import alleycats.{ConsK, Empty, EmptyK, Pure} import cats.kernel.{CommutativeMonoid, CommutativeSemigroup} -/** allows semi automatically derive each instance. The derivation might need help when - * there are fields with a type constructor that comes with instances, e.g. +/** allows semi automatically derive each instance. The derivation might need help when there are fields with a type + * constructor that comes with instances, e.g. * {{{ * scala> case class Bar(a: String) * scala> case class Foo(bars: List[Bar]) @@ -29,9 +29,9 @@ import cats.kernel.{CommutativeMonoid, CommutativeSemigroup} * scala> implicit val fooShow: Show[Foo] = { | * import cats.derived.auto.show._ | * cats.derived.semiauto.show | - * } - * scala> Foo(List(Bar("a"))).show - * res3: String = Foo(bars = List(Bar(a = a))) + * } + * scala> Foo(List(Bar("a"))).show + * res3: String = Foo(bars = List(Bar(a = a))) * }}} */ object semiauto { diff --git a/core/src/main/scala/cats/derived/package.scala b/core/src/main/scala/cats/derived/package.scala index 6ec9fa08..005ad2a9 100644 --- a/core/src/main/scala/cats/derived/package.scala +++ b/core/src/main/scala/cats/derived/package.scala @@ -6,9 +6,8 @@ import cats.derived.util.VersionSpecific.Lazy import cats.kernel.{CommutativeMonoid, CommutativeSemigroup} import shapeless.{Cached, Refute} -/** Fully automatically derive the instance, note that this derivation is not cached, so it - * will re-derive every time an instance is needed in the application, which could - * significantly impact the compilation time. +/** Fully automatically derive the instance, note that this derivation is not cached, so it will re-derive every time an + * instance is needed in the application, which could significantly impact the compilation time. */ object auto { @@ -277,8 +276,8 @@ object auto { } } -/** cached cache the derived instance but this cache are global, so be cautious only use it - * when there is only one instance globally in your application. +/** cached cache the derived instance but this cache are global, so be cautious only use it when there is only one + * instance globally in your application. */ object cached { @@ -495,8 +494,8 @@ abstract private[derived] class SemiAutoInstances { def iterable[F[_], A](fa: F[A])(implicit F: MkIterable[F]): Iterable[A] = F.iterable(fa) } -/** allows semi automatically derive each instance. The derivation might need help when - * there are fields with a type constructor that comes with instances, e.g. +/** allows semi automatically derive each instance. The derivation might need help when there are fields with a type + * constructor that comes with instances, e.g. * {{{ * scala> case class Bar(a: String) * scala> case class Foo(bars: List[Bar]) @@ -520,9 +519,9 @@ abstract private[derived] class SemiAutoInstances { * scala> implicit val fooShow: Show[Foo] = { | * import cats.derived.auto.show._ | * cats.derived.semi.show | - * } - * scala> Foo(List(Bar("a"))).show - * res3: String = Foo(bars = List(Bar(a = a))) + * } + * scala> Foo(List(Bar("a"))).show + * res3: String = Foo(bars = List(Bar(a = a))) * }}} */ @deprecated(message = "Use semiauto instead.", since = "2.1.0") diff --git a/core/src/main/scala/cats/derived/show.scala b/core/src/main/scala/cats/derived/show.scala index 1af55e90..0994808f 100644 --- a/core/src/main/scala/cats/derived/show.scala +++ b/core/src/main/scala/cats/derived/show.scala @@ -8,16 +8,12 @@ import util.VersionSpecific.{Lazy, OrElse} import scala.annotation.implicitNotFound import scala.reflect.ClassTag -/** Due to a limitation in the way Shapeless' `describe` is currently - * implemented, `Show` can't be derived for ADTs which are _both_ - * recursive _and_ generic in one or more type parameters. +/** Due to a limitation in the way Shapeless' `describe` is currently implemented, `Show` can't be derived for ADTs + * which are _both_ recursive _and_ generic in one or more type parameters. * - * See: - * https://github.com/typelevel/kittens/pull/48#issue-249836267 - * https://github.com/milessabin/shapeless/issues/750 + * See: https://github.com/typelevel/kittens/pull/48#issue-249836267 https://github.com/milessabin/shapeless/issues/750 * - * See the test suite for more precise examples of what can and cannot - * be derived. + * See the test suite for more precise examples of what can and cannot be derived. */ @implicitNotFound("""Could not derive an instance of Show[A] where A = ${A}. Make sure that A satisfies one of the following conditions: diff --git a/core/src/main/scala/cats/derived/util/liftSome.scala b/core/src/main/scala/cats/derived/util/liftSome.scala index da63115a..35d59337 100644 --- a/core/src/main/scala/cats/derived/util/liftSome.scala +++ b/core/src/main/scala/cats/derived/util/liftSome.scala @@ -18,8 +18,8 @@ package cats.derived.util import shapeless._ -/** Summons all available instances of the typeclass `F` for members of the coproduct `C`. - * Unlike `LiftAll` members of the coproduct without an instance will be skipped in the result. +/** Summons all available instances of the typeclass `F` for members of the coproduct `C`. Unlike `LiftAll` members of + * the coproduct without an instance will be skipped in the result. */ sealed trait LiftSome[F[_], C <: Coproduct] extends Serializable { type Out <: HList diff --git a/core/src/test/scala/cats/derived/KittensSuite.scala b/core/src/test/scala/cats/derived/KittensSuite.scala index 924f256a..0f631bfd 100644 --- a/core/src/test/scala/cats/derived/KittensSuite.scala +++ b/core/src/test/scala/cats/derived/KittensSuite.scala @@ -21,10 +21,8 @@ import cats.syntax.AllSyntax import munit.DisciplineSuite import org.scalacheck.Test.Parameters -/** An opinionated stack of traits to improve consistency and reduce - * boilerplate in Kittens tests. Note that unlike the corresponding - * CatsSuite in the Cat project, this trait does not mix in any - * instances. +/** An opinionated stack of traits to improve consistency and reduce boilerplate in Kittens tests. Note that unlike the + * corresponding CatsSuite in the Cat project, this trait does not mix in any instances. */ abstract class KittensSuite extends DisciplineSuite with AllSyntax { override val scalaCheckTestParameters: Parameters = super.scalaCheckTestParameters