Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.4.2 #4129

Merged
merged 2 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=3.4.0
version=3.4.2
align.openParenCallSite = true
align.openParenDefnSite = true
maxColumn = 120
Expand Down
6 changes: 3 additions & 3 deletions project/TupleBifunctorInstancesBoiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ object GenTupleBifunctorInstances extends Template {
|
|private[cats] trait NTupleBifunctorInstances {
${if (arity > 1)
block"""
block"""
- implicit final def catsStdBifunctorForTuple$arity${`[A0, A(N - 2)]`}: Bifunctor[${`(A..N - 2, *, *)`}] =
- new Bifunctor[${`(A..N - 2, *, *)`}] {
- def bimap[A, B, C, D](fa: (${`A0, A(N - 2)`}A, B))(f: A => C, g: B => D): (${`A0, A(N - 2)`}C, D) = (${`fa._1..fa._(n - 2)`}f(fa._${arity - 1}), g(fa._$arity))
- }"""
else
block"""
else
block"""
-"""}
|}"""
}
Expand Down
6 changes: 3 additions & 3 deletions project/TupleBitraverseInstancesBoiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object GenTupleBitraverseInstances extends Template {
|
|private[cats] trait NTupleBitraverseInstances {
${if (arity > 1)
block"""
block"""
- implicit final def catsStdBitraverseForTuple$arity${`[A0, A(N - 2)]`}: Bitraverse[${`(A..N - 2, *, *)`}] =
- new Bitraverse[${`(A..N - 2, *, *)`}] {
- def bitraverse[G[_], A, B, C, D](fa: (${`A0, A(N - 2)`}A, B))(f: A => G[C], g: B => G[D])(implicit G: Applicative[G]): G[(${`A0, A(N - 2)`}C, D)] =
Expand All @@ -29,8 +29,8 @@ ${if (arity > 1)
- def bifoldRight[A, B, C](fa: (${`A0, A(N - 2)`}A, B), c: Eval[C])(f: (A, Eval[C]) => Eval[C], g: (B, Eval[C]) => Eval[C]): Eval[C] =
- g(fa._$arity, f(fa._${arity - 1}, c))
- }"""
else
block"""
else
block"""
-"""}
|}"""
}
Expand Down
12 changes: 6 additions & 6 deletions project/TupleMonadInstancesBoiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ object GenTupleMonadInstances extends Template {
|}
|private[cats] sealed trait NTupleMonadInstances1 extends NTupleMonadInstances2 {
- implicit final def catsStdCommutativeMonadForTuple$arity${`[A0, A(N - 1)]`}${`constraints A..(N-1)`(
"CommutativeMonoid"
)}
"CommutativeMonoid"
)}
- : CommutativeMonad[${`(A..N - 1, *)`}] =
- new FlatMapTuple$arity${`[A0, A(N - 1)]`}(${`A0, A(N - 1)`}) with CommutativeMonad[${`(A..N - 1, *)`}] {
- def pure[A](a: A): ${`A0, A(N - 1)&`("A")} = $monadPureMethod
- }
|}
|private[cats] sealed trait NTupleMonadInstances2 extends NTupleMonadInstances3 {
- implicit final def catsStdCommutativeFlatMapForTuple$arity${`[A0, A(N - 1)]`}${`constraints A..(N-1)`(
"CommutativeSemigroup"
)}
"CommutativeSemigroup"
)}
- : CommutativeFlatMap[${`(A..N - 1, *)`}] =
- new FlatMapTuple$arity${`[A0, A(N - 1)]`}(${`A0, A(N - 1)`}) with CommutativeFlatMap[${`(A..N - 1, *)`}]
|}
Expand Down Expand Up @@ -123,7 +123,7 @@ object GenTupleMonadInstances extends Template {
- val xb = f(fa._$arity)
- ${`combine A..(N - 1)`("fa", "xb", s"xb._$arity")}
"""
else block"""
else block"""
- f(fa._1)
"""}
- }
Expand All @@ -149,7 +149,7 @@ object GenTupleMonadInstances extends Template {
- case (${`a0, a(n - 1)`}, Right(b)) => (${`a0, a(n - 1)`}, b)
- case (${`a0, a(n - 1)`}, Left(nextA)) => loop((${`a0, a(n - 1)`}), nextA)
"""
else block"""
else block"""
- def loop(aa: A): Tuple1[B] =
- f(aa) match {
- case Tuple1(Right(b)) => Tuple1(b)
Expand Down
6 changes: 3 additions & 3 deletions tests/src/test/scala/cats/tests/TupleSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ class TupleSuite extends CatsSuite {
assert((foo1, bar1).show === s"(${Show[Foo].show(foo1)},${Show[Bar].show(bar1)})")
assert((foo1, bar1, baz1).show === s"(${Show[Foo].show(foo1)},${Show[Bar].show(bar1)},${Show[Baz].show(baz1)})")
assert((foo1, bar1, baz1, foo2, bar2, baz2).show === s"(${Show[Foo].show(foo1)},${Show[Bar].show(bar1)},${Show[Baz]
.show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz].show(baz2)})")
.show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz].show(baz2)})")
assert((foo1, bar1, baz1, foo2, bar2, baz2, foo3, bar3, baz3).show === s"(${Show[Foo].show(foo1)},${Show[Bar]
.show(bar1)},${Show[Baz].show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz]
.show(baz2)},${Show[Foo].show(foo3)},${Show[Bar].show(bar3)},${Show[Baz].show(baz3)})")
.show(bar1)},${Show[Baz].show(baz1)},${Show[Foo].show(foo2)},${Show[Bar].show(bar2)},${Show[Baz]
.show(baz2)},${Show[Foo].show(foo3)},${Show[Bar].show(bar3)},${Show[Baz].show(baz3)})")
}
}