Skip to content
Permalink
Browse files

Update to Scalafmt 2.0.0

  • Loading branch information...
travisbrown committed Jun 29, 2019
1 parent 619226b commit f975e601d48d7ef90263a5c50818ba6ab220f2cc
@@ -1,4 +1,4 @@
version = 2.0.0-RC5
version = 2.0.0
continuationIndent.defnSite = 2
docstrings = JavaDoc
includeCurlyBraceInSelectChains = false
@@ -7,4 +7,10 @@ newlines.alwaysBeforeElseAfterCurlyIf = false
newlines.alwaysBeforeMultilineDef = false
optIn.breakChainOnFirstMethodDot = false
spaces.inImportCurlyBraces = true

rewrite.rules = [
AvoidInfix,
RedundantBraces,
RedundantParens,
AsciiSortImports,
PreferCurlyFors
]
@@ -130,9 +130,9 @@ lazy val publishSettings = Seq(
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
Some("snapshots".at(nexus + "content/repositories/snapshots"))
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
Some("releases".at(nexus + "service/local/staging/deploy/maven2"))
},
autoAPIMappings := true,
apiURL := Some(url("https://travisbrown.github.io/catbird/api/")),
@@ -163,11 +163,10 @@ credentials ++= (
for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)
} yield Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)
).toSeq
@@ -56,15 +56,14 @@ trait RerunnableInstances {
final def bracketCase[A, B](acquire: Rerunnable[A])(use: A => Rerunnable[B])(
release: (A, ExitCase[Throwable]) => Rerunnable[Unit]
): Rerunnable[B] = new Rerunnable[B] {
final def run: Future[B] = {
final def run: Future[B] =
acquire.run.flatMap { a =>
val future = use(a).run
future.transform {
case Return(b) => release(a, ExitCase.complete).run.flatMap(_ => future)
case Throw(err) => release(a, ExitCase.error(err)).run.flatMap(_ => future)
}
}
}
}
}
}
@@ -62,7 +62,7 @@ abstract class Rerunnable[+A] { self =>

final object Rerunnable extends RerunnableInstances1 {
@tailrec
private[this] def reassociate[B](bind: Bind[B]): Bind[B] = {
private[this] def reassociate[B](bind: Bind[B]): Bind[B] =
if (bind.fa.isInstanceOf[Bind[_]]) {
val inner = bind.fa.asInstanceOf[Bind[bind.P]]
val next = new Bind[B] {
@@ -80,7 +80,6 @@ final object Rerunnable extends RerunnableInstances1 {

reassociate(next)
} else bind
}

private[util] abstract class Bind[B] extends Rerunnable[B] { self =>
type P
@@ -1,7 +1,7 @@
package io.catbird
package util

import cats.{ Eq, Monad, Monoid, StackSafeMonad, Semigroup }
import cats.{ Eq, Monad, Monoid, Semigroup, StackSafeMonad }
import com.twitter.concurrent._
import com.twitter.util._

0 comments on commit f975e60

Please sign in to comment.
You can’t perform that action at this time.