Skip to content

Commit

Permalink
Merge pull request #495 from tpolecat/update-deps
Browse files Browse the repository at this point in the history
update deps
  • Loading branch information
tpolecat authored Jun 3, 2021
2 parents 69c3595 + 494e326 commit 186096d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 23 deletions.
19 changes: 6 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Our Scala versions.
lazy val `scala-2.12` = "2.12.13"
lazy val `scala-2.13` = "2.13.5"
lazy val `scala-2.13` = "2.13.6"
lazy val `scala-3.0` = "3.0.0"

// This is used in a couple places
Expand Down Expand Up @@ -52,7 +52,7 @@ lazy val commonSettings = Seq(
"-doc-source-url", "https://github.com/tpolecat/skunk/blob/v" + version.value + "€{FILE_PATH}.scala",
),
libraryDependencies ++= Seq(
compilerPlugin("org.typelevel" %% "kind-projector" % "0.11.3" cross CrossVersion.full),
compilerPlugin("org.typelevel" %% "kind-projector" % "0.13.0" cross CrossVersion.full),
).filterNot(_ => scalaVersion.value.startsWith("3.")),

// Coverage Exclusions
Expand Down Expand Up @@ -134,17 +134,10 @@ lazy val circe = project
.settings(commonSettings)
.settings(
name := "skunk-circe",
libraryDependencies ++= {
lazy val circeVersion: String =
scalaVersion.value match {
case `scala-3.0` => "0.14.0-M7"
case _ => "0.13.0"
}
Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion
)
}
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % "0.14.1",
"io.circe" %% "circe-parser" % "0.14.1"
)
)

lazy val tests = project
Expand Down
34 changes: 26 additions & 8 deletions modules/docs/src/main/scala/mdoc/Main.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2020 by Rob Norris
// Copyright (c) 2018-2021 by Rob Norris
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -64,11 +64,11 @@ object Main {

// copy-pasted from mdoc source, adding `pprinter` as an arg
case class ReplVariablePrinter(
leadingNewline: Boolean = true,
width: Int = 80,
height: Int = 80,
indent: Int = 2,
pprinter: PPrinter = PPrinter.BlackWhite,
leadingNewline: Boolean = true,
width: Int = 80,
height: Int = 80,
indent: Int = 2,
pprinter: PPrinter = PPrinter.BlackWhite,
) extends (_root_.mdoc.Variable => String) {

override def apply(binder: Variable): String = {
Expand All @@ -85,7 +85,7 @@ case class ReplVariablePrinter(
.append(binder.staticType)
.append(" = ")
if (binder.isToString) {
Renderer.appendMultiline(sb, binder.runtimeValue.toString)
appendMultiline(sb, binder.runtimeValue.toString)
} else {
val heightOverride = binder.mods.heightOverride
val widthOverride = binder.mods.widthOverride
Expand All @@ -99,11 +99,29 @@ case class ReplVariablePrinter(
)
lines.foreach { lineStr =>
val line = lineStr.plainText
Renderer.appendMultiline(sb, line)
appendMultiline(sb, line)
}
}
baos.toString()
}
}

def appendMultiline(sb: PrintStream, string: String): Unit = {
appendMultiline(sb, string, string.length)
}

def appendMultiline(sb: PrintStream, string: String, N: Int): Unit = {
var i = 0
while (i < N) {
string.charAt(i) match {
case '\n' =>
sb.append("\n// ")
case ch =>
sb.append(ch)
}
i += 1
}
}
}


2 changes: 1 addition & 1 deletion modules/docs/src/main/scala/mdoc/package.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2020 by Rob Norris
// Copyright (c) 2018-2021 by Rob Norris
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.3")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.20")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.21")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2")
addSbtPlugin("ch.epfl.scala" % "sbt-eviction-rules" % "1.0.0-RC1")

0 comments on commit 186096d

Please sign in to comment.