Skip to content

Commit

Permalink
Update all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
NeQuissimus committed Dec 14, 2019
1 parent 59b9da5 commit fbfed50
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ spaces {
}
optIn.annotationNewlines = true

rewrite.rules = [SortImports, RedundantBraces]
rewrite.rules = [SortImports, RedundantBraces]

version = 2.1.1
10 changes: 4 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val mainScala = "2.12.8"
val allScala = Seq("2.11.12", mainScala)
val mainScala = "2.12.10"
val allScala = Seq("2.11.12", mainScala, "2.13.1")

organization := "com.nequissimus"
name := "zio-slf4j"
Expand All @@ -24,10 +24,10 @@ scmInfo := Some(
)

libraryDependencies ++= Seq(
"com.lihaoyi" %% "sourcecode" % "0.1.7",
"com.lihaoyi" %% "sourcecode" % "0.1.8",
"com.lihaoyi" %% "utest" % "0.6.7" % Test,
"org.scalaz" %% "scalaz-core" % "7.2.29" % Optional,
"dev.zio" %% "zio" % "1.0.0-RC16",
"dev.zio" %% "zio" % "1.0.0-RC17",
"org.slf4j" % "slf4j-api" % "1.7.29",
compilerPlugin("com.github.ghik" %% "silencer-plugin" % "1.4.2"),
"com.github.ghik" %% "silencer-lib" % "1.4.2" % Provided
Expand Down Expand Up @@ -78,5 +78,3 @@ scalacOptions ++= Seq(
})

crossScalaVersions := allScala

addCommandAlias("format", "all scalafmtSbt scalafmt test:scalafmt")
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.5")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.7")
addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.1.1")
Binary file removed project/zecret
Binary file not shown.
18 changes: 9 additions & 9 deletions src/test/scala/sample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ package sample

import nequi.zio.logger._

import scalaz.Scalaz._

import zio._

// Very simple ZIO app
object SampleApp extends App {
def run(args: List[String]): ZIO[Environment, Nothing, Int] = {
val logged: ZIO[Logger, Nothing, Unit] = info(42)
def run(args: List[String]): ZIO[Any, Nothing, Int] = {

// Some logic that logs
def logged(i: Int): ZIO[Logger, Nothing, Int] = info(s"Got ${i}") *> ZIO.effectTotal(i + 2)

val provided: ZIO[Any, Nothing, Unit] = logged.provideSome(_ => Slf4jLogger.create)
// Provide a standard Slf4j logger
val provided: ZIO[Any, Nothing, Int] = logged(42).provideSome(_ => Slf4jLogger.create)

provided.fold(
_ => 1,
_ => 0
)
// Adjust app exit code to signal success
provided.map(_ => 0)
}
}

0 comments on commit fbfed50

Please sign in to comment.