Skip to content

Commit

Permalink
Build: Scalafmt - De-indent extends to get superclass constructor p…
Browse files Browse the repository at this point in the history
…arams at the right indent
  • Loading branch information
raquo committed Nov 18, 2024
1 parent 73004a0 commit 5072c54
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ runner.dialect = "scala213"
# - Maybe make a separate config for these files, that has two lines before method names, see https://scalameta.org/scalafmt/docs/configuration.html#fileoverride
# - Does this exclusion actually work? IntelliJ seems to ignore it
project.excludePaths = [
"glob:**/src/main/scala/com/raquo/laminar/defs/**",
"glob:**/project/VersionHelper.scala",
"glob:**/src/*/scala-3/**"
"glob:**/src/*/scala/com/raquo/airstream/combine/generated/**"
Expand All @@ -22,7 +21,7 @@ indent.binPackDefnSite = 2
indent.ctorSite = 2
indent.matchSite = 2
indent.caseSite = 2
indent.extendSite = 2
indent.extendSite = 0
indent.withSiteRelativeToExtends = 0
indent.commaSiteRelativeToExtends = 2 # 0 is not allowed
indent.extraBeforeOpenParenDefnSite = 0
Expand Down Expand Up @@ -78,6 +77,7 @@ newlines.afterInfix = keep
newlines.afterInfixBreakOnNested = false # ??? https://scalameta.org/scalafmt/docs/configuration.html#newlinesafterinfixbreakonnested
newlines.avoidForSimpleOverflow = [tooLong, punct, slc]
newlines.avoidInResultType = true
newlines.avoidAfterYield = false
newlines.sometimesBeforeColonInMethodReturnType = false
# newlines.beforeOpenParenDefnSite = keep # TODO not sure https://scalameta.org/scalafmt/docs/configuration.html#newlinesbeforeopenparenxxxsite
# newlines.beforeOpenParenCallSite = keep # TODO only supported for Scala 3. Also, not sure... https://scalameta.org/scalafmt/docs/configuration.html#newlinesbeforeopenparenxxxsite
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/com/raquo/airstream/core/AirstreamError.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ object AirstreamError {
}

case class VarError(message: String, cause: Option[Throwable])
extends AirstreamError(s"$message; cause: ${cause.map(getFullMessage)}") {
extends AirstreamError(s"$message; cause: ${cause.map(getFullMessage)}") {

cause.foreach(initCause)

override def toString: String = s"VarError: $message; cause: $cause"
}

case class ErrorHandlingError(error: Throwable, cause: Throwable)
extends AirstreamError(s"ErrorHandlingError: ${getFullMessage(error)}; cause: ${getFullMessage(cause)}") {
extends AirstreamError(s"ErrorHandlingError: ${getFullMessage(error)}; cause: ${getFullMessage(cause)}") {

initCause(cause)

override def toString: String = s"ErrorHandlingError: $error; cause: $cause"
}

case class CombinedError(causes: Seq[Option[Throwable]])
extends AirstreamError(s"CombinedError: ${causes.flatten.map(getFullMessage).mkString("; ")}") {
extends AirstreamError(s"CombinedError: ${causes.flatten.map(getFullMessage).mkString("; ")}") {

causes.flatten.headOption.foreach(initCause) // Just get the first cause – better than nothing I guess?

Expand All @@ -64,21 +64,21 @@ object AirstreamError {
}

case class ObserverErrorHandlingError(error: Throwable, cause: Throwable)
extends AirstreamError(s"ObserverErrorHandlingError: ${getFullMessage(error)}; cause: ${getFullMessage(cause)}") {
extends AirstreamError(s"ObserverErrorHandlingError: ${getFullMessage(error)}; cause: ${getFullMessage(cause)}") {

initCause(cause)

override def toString: String = s"ObserverErrorHandlingError: $error; cause: $cause"
}

case class DebugError(error: Throwable, cause: Option[Throwable])
extends AirstreamError(s"DebugError: ${getFullMessage(error)}; cause: ${cause.map(getFullMessage)}") {
extends AirstreamError(s"DebugError: ${getFullMessage(error)}; cause: ${cause.map(getFullMessage)}") {

override def toString: String = s"DebugError: $error; cause: $cause"
}

case class TransactionDepthExceeded(trx: Transaction, depth: Int)
extends AirstreamError(s"Transaction depth exceeded maxDepth = $depth: Execution of $trx aborted. See `Transaction.maxDepth`.") {
extends AirstreamError(s"Transaction depth exceeded maxDepth = $depth: Execution of $trx aborted. See `Transaction.maxDepth`.") {

override def toString: String = s"TransactionDepthExceeded: $trx; maxDepth: $depth"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class DerivedVarSignal[A, B](
owner: Owner,
parentDisplayName: => String
) extends MapSignal[A, B](
parent.signal,
project = zoomIn,
recover = None
) with OwnedSignal[B] {
parent.signal,
project = zoomIn,
recover = None
) with OwnedSignal[B] {

// Note that even if owner kills subscription, this signal might remain due to other listeners
override protected[state] def isStarted: Boolean = super.isStarted
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/com/raquo/airstream/state/ObservedSignal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class ObservedSignal[A](
observer: Observer[A],
owner: Owner
) extends MapSignal[A, A](
parent,
project = identity,
recover = None
) with OwnedSignal[A] {
parent,
project = identity,
recover = None
) with OwnedSignal[A] {

override protected[this] val subscription: Subscription = addObserver(observer)(owner)

Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/com/raquo/airstream/web/FetchStream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import scala.scalajs.js
* and some other Javascript-specific data types.
*/
object FetchStream extends FetchBuilder[dom.BodyInit, String](
encodeRequest = identity,
decodeResponse = response => EventStream.fromJsPromise(response.text())
) {
encodeRequest = identity,
decodeResponse = response => EventStream.fromJsPromise(response.text())
) {

lazy val raw: FetchBuilder[dom.BodyInit, dom.Response] = {
new FetchBuilder(identity, EventStream.fromValue(_))
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/raquo/airstream/web/WebStorageVar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class WebStorageVar[A] private[web] (
default: => Try[A],
syncDistinctByFn: (A, A) => Boolean
) extends SourceVar[A](
initial = maybeStorage().flatMap(s => Option(s.getItem(key)).map(decode)).getOrElse(default)
) {
initial = maybeStorage().flatMap(s => Option(s.getItem(key)).map(decode)).getOrElse(default)
) {

private[web] val owner = new ManualOwner

Expand Down

0 comments on commit 5072c54

Please sign in to comment.