Skip to content

Commit

Permalink
project: upgrade scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Feb 22, 2024
1 parent fb3007b commit efca07f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.17"
version = "3.8.0"
runner.dialect = scala3

maxColumn = 120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ case class Operation[A](operation: () => Throwable Either A, last: Vector[Finali

def attempt: Operation[Throwable Either A] =
Operation(
() =>
() => {
try Right(run)
catch {
case NonFatal(t) => Right(Left(t))
},
catch { case NonFatal(t) => Right(Left(t)) }
},
last
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ case class Producer[F[_]: Monad: Safe, A](run: F[LazyList[F, A]]):
case One(a) => onLastState(s) >> one[F, A](a).run
case More(as, next) =>
val newS = as.foldLeft(s)(f)
(emit[F, A](as) `append` go(next, newS)).run
emit[F, A](as).append(go(next, newS)).run
}
}

Expand Down Expand Up @@ -365,7 +365,7 @@ case class Producer[F[_]: Monad: Safe, A](run: F[LazyList[F, A]]):
Producer(p.peek flatMap {
case (Some(a), as) =>
val ps = if previous.size < n then previous else previous.drop(1)
(one[F, (List[A], A)]((previous.take(n).toList, a)) `append` go(as, ps :+ a)).run
one[F, (List[A], A)]((previous.take(n).toList, a)).append(go(as, ps :+ a)).run
case (_, _) =>
done[F, (List[A], A)].run
})
Expand Down Expand Up @@ -446,7 +446,7 @@ case class Producer[F[_]: Monad: Safe, A](run: F[LazyList[F, A]]):
case One(a) => one[F, B](f(previous, a)).run
case More(as, next) =>
val scanned = as.scanLeft(previous)(f).drop(1)
(emit[F, B](scanned) `append` go(next, scanned.lastOption.getOrElse(previous))).run
emit[F, B](scanned).append(go(next, scanned.lastOption.getOrElse(previous))).run
})

one[F, B](start) `append` go(this, start)
Expand All @@ -462,7 +462,7 @@ case class Producer[F[_]: Monad: Safe, A](run: F[LazyList[F, A]]):
val (b, s2) = f(a, s1)
(bs1 :+ b, s2)
}
(emit[F, B](bs) `append` go(next, news)).run
emit[F, B](bs).append(go(next, news)).run
})
go(this, start)

Expand Down Expand Up @@ -501,7 +501,7 @@ case class Producer[F[_]: Monad: Safe, A](run: F[LazyList[F, A]]):
case List() => go(next, s).run
case a :: rest =>
val (b, s1) = f(a, s)
(one[F, F[B]](b) `append` go(emit[F, A](rest) `append` next, s1)).run
one[F, F[B]](b).append(go(emit[F, A](rest) `append` next, s1)).run
}
})

Expand Down Expand Up @@ -565,7 +565,7 @@ case class Producer[F[_]: Monad: Safe, A](run: F[LazyList[F, A]]):
val (pb1, s2) = f(a, s1)
(pb `append` pb1, s2)
}
(bs `append` go(next, news)).run
bs.append(go(next, news)).run
})
go(this, start)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ case class DefaultSelector(commandLineArguments: Arguments) extends Selector:
(List(f), updateSections(sections, t))

case (fragment, sections) if !Fragment.isFormatting(fragment) && !Fragment.isEmptyText(fragment) =>
val apply = sections.sumAll
val keep = apply.keep(arguments, apply.names)
val apply = sections.sumAll;
val keep = apply.keep(arguments, apply.names);
(List(newLine, fragment).filter(_ => keep), sections)

case (fragment, sections) =>
Expand Down

0 comments on commit efca07f

Please sign in to comment.