rtimush / zio-magic-comments   0.1.0

BSD 3-clause "New" or "Revised" License GitHub

ZioMagicComments is a Scalafix rule that adds explanatory graphs as comments to zio-magic methods

Scala versions: 2.13 2.12

zio-magic-comments

ZioMagicComments is a Scalafix rule that adds explanatory graphs as comments to zio-magic methods:

class Demo {
  val program: URIO[Cake, Unit] = ...

  //         Cake.live         ⎫
  //      ┌──────┴─────┐       ⎬ added by ZioMagicComments
  // Clock.live  Blocking.live ⎭
  val magically =
    program.provideMagicLayer(
      Cake.live,
      Clock.live,
      Blocking.live
    )
}

Getting started

Follow the Scalafix documentation to make it possible to run Scalafix rules in your build. Then either run

sbt> scalafix dependency:[email protected]:zio-magic-comments:0.1.0

or include the rule in your build.sbt:

ThisBuild / scalafixDependencies += "com.timushev" %% "zio-magic-comments" % "0.1.0"

Demo