Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.12 KB

README.md

File metadata and controls

37 lines (30 loc) · 1.12 KB

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