Skip to content

Commit

Permalink
Revert documentation format changes
Browse files Browse the repository at this point in the history
Scalafmt 3.8.4 introduced some formatting bugs that are reverted with this pull request.

Issue in Scalafmt:
- scalameta/scalafmt#4716

Bad formatting got merged to cats-effect in:
- #4235
  • Loading branch information
mzuehlke committed Jan 20, 2025
1 parent cb3c29b commit ba11dfe
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 28 deletions.
4 changes: 2 additions & 2 deletions core/js/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import scala.util.Try
* }
* }}}
*
* It is valid to define `val run` rather than `def run` because `IO` 's evaluation is lazy: it
* It is valid to define `val run` rather than `def run` because `IO`'s evaluation is lazy: it
* will only run when the `main` method is invoked by the runtime.
*
* In the event that the process receives an interrupt signal (`SIGINT`) due to Ctrl-C (or any
Expand Down Expand Up @@ -121,7 +121,7 @@ import scala.util.Try
*
* However, with that said, there really is no substitute to benchmarking your own application.
* Every application and scenario is unique, and you will always get the absolute best results
* by performing your own tuning rather than trusting someone else's defaults. `IOApp` 's
* by performing your own tuning rather than trusting someone else's defaults. `IOApp`'s
* defaults are very ''good'', but they are not perfect in all cases. One common example of this
* is applications which maintain network or file I/O worker threads which are under heavy load
* in steady-state operations. In such a performance profile, it is usually better to reduce the
Expand Down
4 changes: 2 additions & 2 deletions core/jvm/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import java.util.concurrent.atomic.AtomicInteger
* }
* }}}
*
* It is valid to define `val run` rather than `def run` because `IO` 's evaluation is lazy: it
* It is valid to define `val run` rather than `def run` because `IO`'s evaluation is lazy: it
* will only run when the `main` method is invoked by the runtime.
*
* In the event that the process receives an interrupt signal (`SIGINT`) due to Ctrl-C (or any
Expand Down Expand Up @@ -124,7 +124,7 @@ import java.util.concurrent.atomic.AtomicInteger
*
* However, with that said, there really is no substitute to benchmarking your own application.
* Every application and scenario is unique, and you will always get the absolute best results
* by performing your own tuning rather than trusting someone else's defaults. `IOApp` 's
* by performing your own tuning rather than trusting someone else's defaults. `IOApp`'s
* defaults are very ''good'', but they are not perfect in all cases. One common example of this
* is applications which maintain network or file I/O worker threads which are under heavy load
* in steady-state operations. In such a performance profile, it is usually better to reduce the
Expand Down
2 changes: 1 addition & 1 deletion core/jvm/src/main/scala/cats/effect/IOPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract private[effect] class IOPlatform[+A] extends Serializable { self: IO[A]
* The first line will run `program` for at most five seconds, interrupt the calculation, and
* run the finalizers for as long as they need to complete. The second line will run `program`
* for at most five seconds and then immediately release the latch, without interrupting
* `program` 's ongoing execution.
* `program`'s ongoing execution.
*
* In other words, this function probably doesn't do what you think it does, and you probably
* don't want to use it outside of tests.
Expand Down
7 changes: 3 additions & 4 deletions core/jvm/src/main/scala/cats/effect/unsafe/FiberMonitor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ import scala.concurrent.ExecutionContext
* `IO#evalOn`).
* 1. Because `java.util.Collections.synchronizedMap` is a simple wrapper around any map which
* just synchronizes the access to the map through the built in JVM `synchronized`
* mechanism, we need several instances of these synchronized `WeakHashMap` s just to
* reduce contention between threads. A particular instance is selected using a thread
* local source of randomness using an instance of
* `java.util.concurrent.ThreadLocalRandom`.
* mechanism, we need several instances of these synchronized `WeakHashMap`s just to reduce
* contention between threads. A particular instance is selected using a thread local
* source of randomness using an instance of `java.util.concurrent.ThreadLocalRandom`.
*/
private[effect] sealed class FiberMonitor(
// A reference to the compute pool of the `IORuntime` in which this suspended fiber bag
Expand Down
2 changes: 1 addition & 1 deletion core/jvm/src/main/scala/cats/effect/unsafe/TimerHeap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicInteger
*
* In general, this heap is not threadsafe and modifications (insertion/removal) may only be
* performed on its owner WorkerThread. The exception is that the callback value of nodes may be
* `null` ed by other threads and published via data race.
* `null`ed by other threads and published via data race.
*
* Other threads may traverse the heap with the `steal` method during which they may `null` some
* callbacks. This is entirely subject to data races.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private[effect] final class WorkerThread[P <: AnyRef](
* continues with the worker thread run loop.
*
* @param fiber
* the fiber that `cede` s/`autoCede`s
* the fiber that `cede`s/`autoCede`s
*/
def reschedule(fiber: Runnable): Unit = {
if ((cedeBypass eq null) && queue.isEmpty()) {
Expand Down
4 changes: 2 additions & 2 deletions core/native/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import scala.scalanative.meta.LinktimeInfo._
* }
* }}}
*
* It is valid to define `val run` rather than `def run` because `IO` 's evaluation is lazy: it
* It is valid to define `val run` rather than `def run` because `IO`'s evaluation is lazy: it
* will only run when the `main` method is invoked by the runtime.
*
* In the event that the process receives an interrupt signal (`SIGINT`) due to Ctrl-C (or any
Expand Down Expand Up @@ -119,7 +119,7 @@ import scala.scalanative.meta.LinktimeInfo._
*
* However, with that said, there really is no substitute to benchmarking your own application.
* Every application and scenario is unique, and you will always get the absolute best results
* by performing your own tuning rather than trusting someone else's defaults. `IOApp` 's
* by performing your own tuning rather than trusting someone else's defaults. `IOApp`'s
* defaults are very ''good'', but they are not perfect in all cases. One common example of this
* is applications which maintain network or file I/O worker threads which are under heavy load
* in steady-state operations. In such a performance profile, it is usually better to reduce the
Expand Down
4 changes: 2 additions & 2 deletions core/shared/src/main/scala/cats/effect/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ sealed abstract class IO[+A] private () extends IOPlatform[A] {
/**
* Materializes any sequenced exceptions into value space, where they may be handled.
*
* This is analogous to the `catch` clause in `try` /`catch`, being the inverse of
* This is analogous to the `catch` clause in `try`/`catch`, being the inverse of
* `IO.raiseError`. Thus:
*
* {{{
Expand Down Expand Up @@ -1310,7 +1310,7 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits with TuplePara
* The effect returns `Either[Option[IO[Unit]], A]` where:
* - right side `A` is an immediate result of computation (callback invocation will be
* dropped);
* - left side `Option[IO[Unit]] ` is an optional finalizer to be run in the event that the
* - left side `Option[IO[Unit]]` is an optional finalizer to be run in the event that the
* fiber running `asyncCheckAttempt(k)` is canceled.
*
* For example, here is a simplified version of `IO.fromCompletableFuture`:
Expand Down
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/cats/effect/ResourceApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import cats.syntax.all._
* [[https://tpolecat.github.io/skunk/ Skunk]] and [[https://http4s.org Http4s]], but otherwise
* it represents a relatively typical example of what the main class for a realistic Cats Effect
* application might look like. Notably, the whole thing is enclosed in `Resource`, which is
* `use` d at the very end. This kind of pattern is so common that `ResourceApp` defines a
* `use`d at the very end. This kind of pattern is so common that `ResourceApp` defines a
* special trait which represents it. We can rewrite the above example:
*
* {{{
Expand Down
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/cats/effect/SyncIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ sealed abstract class SyncIO[+A] private () extends Serializable {
/**
* Materializes any sequenced exceptions into value space, where they may be handled.
*
* This is analogous to the `catch` clause in `try` /`catch`, being the inverse of
* This is analogous to the `catch` clause in `try`/`catch`, being the inverse of
* `SyncIO.raiseError`. Thus:
*
* {{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package unsafe
import scala.concurrent.ExecutionContext

/**
* Builder object for creating custom `IORuntime` s. Useful for creating [[IORuntime]] based on
* Builder object for creating custom `IORuntime`s. Useful for creating [[IORuntime]] based on
* the default one but with some wrappers around execution contexts or custom shutdown hooks.
*/
final class IORuntimeBuilder protected (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ trait GenConcurrent[F[_], E] extends GenSpawn[F, E] {
* and cache the result. If `get` is sequenced multiple times `fa` will only be evaluated
* once.
*
* If all `get` s are canceled prior to `fa` completing, it will be canceled and evaluated
* If all `get`s are canceled prior to `fa` completing, it will be canceled and evaluated
* again the next time `get` is sequenced.
*/
def memoize[A](fa: F[A]): F[F[A]] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ trait MonadCancel[F[_], E] extends MonadError[F, E] {
* Indicates the default "root scope" semantics of the `F` in question. For types which do
* ''not'' implement auto-cancelation, this value may be set to `CancelScope.Uncancelable`,
* which behaves as if all values `F[A]` are wrapped in an implicit "outer" `uncancelable`
* which cannot be polled. Most `IO` -like types will define this to be `Cancelable`.
* which cannot be polled. Most `IO`-like types will define this to be `Cancelable`.
*/
def rootCancelScope: CancelScope

Expand Down
2 changes: 1 addition & 1 deletion kernel/shared/src/main/scala/cats/effect/kernel/Ref.scala
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ object Ref {
F.delay(unsafe(a))

/**
* Creates an instance focused on a component of another `Ref` 's value. Delegates every get
* Creates an instance focused on a component of another `Ref`'s value. Delegates every get
* and modification to underlying `Ref`, so both instances are always in sync.
*
* Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ sealed abstract class Resource[F[_], +A] extends Serializable {
Resource.makeCase(F.unit)((_, ec) => f(ec)).flatMap(_ => this)

/**
* Given a `Resource`, possibly built by composing multiple `Resource` s monadically, returns
* Given a `Resource`, possibly built by composing multiple `Resource`s monadically, returns
* the acquired resource, as well as a cleanup function that takes an
* [[Resource.ExitCase exit case]] and runs all the finalizers for releasing it.
*
Expand Down Expand Up @@ -530,7 +530,7 @@ sealed abstract class Resource[F[_], +A] extends Serializable {
}

/**
* Given a `Resource`, possibly built by composing multiple `Resource` s monadically, returns
* Given a `Resource`, possibly built by composing multiple `Resource`s monadically, returns
* the acquired resource, as well as an action that runs all the finalizers for releasing it.
*
* If the outer `F` fails or is interrupted, `allocated` guarantees that the finalizers will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import java.util.concurrent.atomic.AtomicReference
* [[TestControl.executeEmbed]]).
*
* In other words, `TestControl` is sort of like a "handle" to the runtime internals within the
* context of a specific `IO` 's execution. It makes it possible for users to manipulate and
* context of a specific `IO`'s execution. It makes it possible for users to manipulate and
* observe the execution of the `IO` under test from an external vantage point. It is important
* to understand that the ''outer'' `IO` s (e.g. those returned by the [[tick]] or [[results]]
* to understand that the ''outer'' `IO`s (e.g. those returned by the [[tick]] or [[results]]
* methods) are ''not'' running under the test control environment, and instead they are meant
* to be run by some outer runtime. Interactions between the outer runtime and the inner runtime
* (potentially via mechanisms like [[cats.effect.std.Queue]] or
Expand Down Expand Up @@ -204,7 +204,7 @@ final class TestControl[A] private (
* Analogous to, though critically not the same as, running an [[IO]] on a single-threaded
* production runtime.
*
* This function will terminate for `IO` s which deadlock ''asynchronously'', but any program
* This function will terminate for `IO`s which deadlock ''asynchronously'', but any program
* which runs in a loop without fully suspending will cause this function to run indefinitely.
* Also note that any `IO` which interacts with some external asynchronous scheduler (such as
* NIO) will be considered deadlocked for the purposes of this runtime.
Expand Down Expand Up @@ -288,8 +288,8 @@ object TestControl {
/**
* Executes a given [[IO]] under fully mocked runtime control. Produces a `TestControl` which
* can be used to manipulate the mocked runtime and retrieve the results. Note that the outer
* `IO` (and the `IO` s produced by the `TestControl`) do ''not'' evaluate under mocked
* runtime control and must be evaluated by some external harness, usually some test framework
* `IO` (and the `IO`s produced by the `TestControl`) do ''not'' evaluate under mocked runtime
* control and must be evaluated by some external harness, usually some test framework
* integration.
*
* A simple example (returns an `IO` which must, itself, be run) using MUnit assertion syntax:
Expand Down

0 comments on commit ba11dfe

Please sign in to comment.