Skip to content

Commit

Permalink
Merge pull request #3425 from typelevel/update/scalafmt-2.5.2
Browse files Browse the repository at this point in the history
Update Scalafmt to 2.5.2
  • Loading branch information
mpilquist authored May 30, 2020
2 parents 452de16 + b99a854 commit fdb5723
Show file tree
Hide file tree
Showing 270 changed files with 3,998 additions and 3,158 deletions.
4 changes: 2 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version=2.4.2
version=2.5.2
align.openParenCallSite = true
align.openParenDefnSite = true
maxColumn = 120
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
danglingParentheses = true
rewrite.rules = [AvoidInfix, SortImports, RedundantBraces, RedundantParens, SortModifiers]
rewrite.rules = [AvoidInfix, SortImports, RedundantParens, SortModifiers]
docstrings = JavaDoc
newlines.afterCurlyLambda = preserve
22 changes: 12 additions & 10 deletions alleycats-core/src/main/scala/alleycats/ConsK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,23 @@ object ConsK {
trait ToConsKOps {
implicit def toConsKOps[F[_], A](target: F[A])(implicit tc: ConsK[F]): Ops[F, A] {
type TypeClassType = ConsK[F]
} = new Ops[F, A] {
type TypeClassType = ConsK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new Ops[F, A] {
type TypeClassType = ConsK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}
object nonInheritedOps extends ToConsKOps
object ops {
implicit def toAllConsKOps[F[_], A](target: F[A])(implicit tc: ConsK[F]): AllOps[F, A] {
type TypeClassType = ConsK[F]
} = new AllOps[F, A] {
type TypeClassType = ConsK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new AllOps[F, A] {
type TypeClassType = ConsK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}

/****************************************************************************/
Expand Down
22 changes: 12 additions & 10 deletions alleycats-core/src/main/scala/alleycats/Empty.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,23 @@ object Empty extends EmptyInstances0 {
trait ToEmptyOps {
implicit def toEmptyOps[A](target: A)(implicit tc: Empty[A]): Ops[A] {
type TypeClassType = Empty[A]
} = new Ops[A] {
type TypeClassType = Empty[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
} =
new Ops[A] {
type TypeClassType = Empty[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
}
object nonInheritedOps extends ToEmptyOps
object ops {
implicit def toAllEmptyOps[A](target: A)(implicit tc: Empty[A]): AllOps[A] {
type TypeClassType = Empty[A]
} = new AllOps[A] {
type TypeClassType = Empty[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
} =
new AllOps[A] {
type TypeClassType = Empty[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
}

/****************************************************************************/
Expand Down
22 changes: 12 additions & 10 deletions alleycats-core/src/main/scala/alleycats/EmptyK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,23 @@ object EmptyK {
trait ToEmptyKOps {
implicit def toEmptyKOps[F[_], A](target: F[A])(implicit tc: EmptyK[F]): Ops[F, A] {
type TypeClassType = EmptyK[F]
} = new Ops[F, A] {
type TypeClassType = EmptyK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new Ops[F, A] {
type TypeClassType = EmptyK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}
object nonInheritedOps extends ToEmptyKOps
object ops {
implicit def toAllEmptyKOps[F[_], A](target: F[A])(implicit tc: EmptyK[F]): AllOps[F, A] {
type TypeClassType = EmptyK[F]
} = new AllOps[F, A] {
type TypeClassType = EmptyK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new AllOps[F, A] {
type TypeClassType = EmptyK[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}

/****************************************************************************/
Expand Down
22 changes: 12 additions & 10 deletions alleycats-core/src/main/scala/alleycats/Extract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,23 @@ object Extract {
trait ToExtractOps {
implicit def toExtractOps[F[_], A](target: F[A])(implicit tc: Extract[F]): Ops[F, A] {
type TypeClassType = Extract[F]
} = new Ops[F, A] {
type TypeClassType = Extract[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new Ops[F, A] {
type TypeClassType = Extract[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}
object nonInheritedOps extends ToExtractOps
object ops {
implicit def toAllExtractOps[F[_], A](target: F[A])(implicit tc: Extract[F]): AllOps[F, A] {
type TypeClassType = Extract[F]
} = new AllOps[F, A] {
type TypeClassType = Extract[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new AllOps[F, A] {
type TypeClassType = Extract[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}

/****************************************************************************/
Expand Down
22 changes: 12 additions & 10 deletions alleycats-core/src/main/scala/alleycats/One.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,23 @@ object One {
trait ToOneOps {
implicit def toOneOps[A](target: A)(implicit tc: One[A]): Ops[A] {
type TypeClassType = One[A]
} = new Ops[A] {
type TypeClassType = One[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
} =
new Ops[A] {
type TypeClassType = One[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
}
object nonInheritedOps extends ToOneOps
object ops {
implicit def toAllOneOps[A](target: A)(implicit tc: One[A]): AllOps[A] {
type TypeClassType = One[A]
} = new AllOps[A] {
type TypeClassType = One[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
} =
new AllOps[A] {
type TypeClassType = One[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
}

/****************************************************************************/
Expand Down
22 changes: 12 additions & 10 deletions alleycats-core/src/main/scala/alleycats/Pure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,23 @@ object Pure {
trait ToPureOps {
implicit def toPureOps[F[_], A](target: F[A])(implicit tc: Pure[F]): Ops[F, A] {
type TypeClassType = Pure[F]
} = new Ops[F, A] {
type TypeClassType = Pure[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new Ops[F, A] {
type TypeClassType = Pure[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}
object nonInheritedOps extends ToPureOps
object ops {
implicit def toAllPureOps[F[_], A](target: F[A])(implicit tc: Pure[F]): AllOps[F, A] {
type TypeClassType = Pure[F]
} = new AllOps[F, A] {
type TypeClassType = Pure[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
} =
new AllOps[F, A] {
type TypeClassType = Pure[F]
val self: F[A] = target
val typeClassInstance: TypeClassType = tc
}
}

/****************************************************************************/
Expand Down
22 changes: 12 additions & 10 deletions alleycats-core/src/main/scala/alleycats/Zero.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,23 @@ object Zero {
trait ToZeroOps {
implicit def toZeroOps[A](target: A)(implicit tc: Zero[A]): Ops[A] {
type TypeClassType = Zero[A]
} = new Ops[A] {
type TypeClassType = Zero[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
} =
new Ops[A] {
type TypeClassType = Zero[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
}
object nonInheritedOps extends ToZeroOps
object ops {
implicit def toAllZeroOps[A](target: A)(implicit tc: Zero[A]): AllOps[A] {
type TypeClassType = Zero[A]
} = new AllOps[A] {
type TypeClassType = Zero[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
} =
new AllOps[A] {
type TypeClassType = Zero[A]
val self: A = target
val typeClassInstance: TypeClassType = tc
}
}

/****************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import org.typelevel.discipline.Laws
trait FlatMapRecTests[F[_]] extends Laws {
def laws: FlatMapLaws[F]

def tailRecM[A: Arbitrary](implicit
ArbFA: Arbitrary[F[A]],
ArbAFA: Arbitrary[A => F[A]],
EqFA: Eq[F[A]]): RuleSet =
def tailRecM[A: Arbitrary](implicit ArbFA: Arbitrary[F[A]], ArbAFA: Arbitrary[A => F[A]], EqFA: Eq[F[A]]): RuleSet =
new DefaultRuleSet(
name = "flatMapTailRec",
parent = None,
Expand Down
26 changes: 15 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ lazy val simulacrumSettings = Seq(
libraryDependencies += "org.typelevel" %% "simulacrum-scalafix-annotations" % "0.2.0",
pomPostProcess := { (node: xml.Node) =>
new RuleTransformer(new RewriteRule {
override def transform(node: xml.Node): Seq[xml.Node] = node match {
case e: xml.Elem
if e.label == "dependency" &&
e.child.exists(child => child.label == "groupId" && child.text == "org.typelevel") &&
e.child.exists(child => child.label == "artifactId" && child.text.startsWith("simulacrum")) =>
Nil
case _ => Seq(node)
}
override def transform(node: xml.Node): Seq[xml.Node] =
node match {
case e: xml.Elem
if e.label == "dependency" &&
e.child.exists(child => child.label == "groupId" && child.text == "org.typelevel") &&
e.child.exists(child => child.label == "artifactId" && child.text.startsWith("simulacrum")) =>
Nil
case _ => Seq(node)
}
}).transform(node).head
}
)
Expand Down Expand Up @@ -140,7 +141,8 @@ lazy val includeGeneratedSrc: Setting[_] = {

lazy val disciplineDependencies = Seq(
libraryDependencies ++= Seq("org.scalacheck" %%% "scalacheck" % scalaCheckVersion,
"org.typelevel" %%% "discipline-core" % disciplineVersion)
"org.typelevel" %%% "discipline-core" % disciplineVersion
)
)

lazy val testingDependencies = Seq(
Expand Down Expand Up @@ -424,7 +426,8 @@ lazy val catsJVM = project
alleycatsLaws.jvm,
alleycatsTests.jvm,
jvm,
docs)
docs
)
.dependsOn(
kernel.jvm,
kernelLaws.jvm,
Expand Down Expand Up @@ -455,7 +458,8 @@ lazy val catsJS = project
alleycatsCore.js,
alleycatsLaws.js,
alleycatsTests.js,
js)
js
)
.dependsOn(
kernel.js,
kernelLaws.js,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ trait ParallelInstances extends ParallelInstances1 {
cats.instances.either.catsParallelForEitherAndValidated[E]

@deprecated("Use OptionT.catsDataParallelForOptionT", "2.0.0")
def catsParallelForOptionTNestedOption[M[_]](
implicit P: Parallel[M]
def catsParallelForOptionTNestedOption[M[_]](implicit
P: Parallel[M]
): Parallel.Aux[OptionT[M, *], Nested[P.F, Option, *]] = OptionT.catsDataParallelForOptionT[M]

@deprecated("Use cats.instances.list.catsStdNonEmptyParallelForListZipList", "2.1.0")
Expand All @@ -29,8 +29,8 @@ trait ParallelInstances extends ParallelInstances1 {
cats.instances.stream.catsStdParallelForStreamZipStream

@deprecated("Use EitherT.catsDataParallelForEitherTWithParallelEffect", "2.0.0")
def catsParallelForEitherTNestedParallelValidated[M[_], E: Semigroup](
implicit P: Parallel[M]
def catsParallelForEitherTNestedParallelValidated[M[_], E: Semigroup](implicit
P: Parallel[M]
): Parallel.Aux[EitherT[M, E, *], Nested[P.F, Validated[E, *], *]] =
EitherT.catsDataParallelForEitherTWithParallelEffect[M, E]
}
Loading

0 comments on commit fdb5723

Please sign in to comment.