Skip to content

Commit

Permalink
upgrade deps (#848)
Browse files Browse the repository at this point in the history
* WIP

* bring in os-lib (replacement for Path/pwd etc.)

* adapt to latest pprint

* latest

* fmt
  • Loading branch information
mpollmeier committed Dec 30, 2021
1 parent 2b8404a commit 31265ad
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name := "joern"
ThisBuild / organization := "io.joern"
ThisBuild / scalaVersion := "2.13.7"

val cpgVersion = "1.3.474"
val js2cpgVersion = "0.2.78"
val cpgVersion = "1.3.475"
val js2cpgVersion = "0.2.82"

lazy val joerncli = Projects.joerncli
lazy val querydb = Projects.querydb
Expand Down
3 changes: 2 additions & 1 deletion console/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ val ScoptVersion = "4.0.1"
val BetterFilesVersion = "3.9.1"
val CaskVersion = "0.8.0"
val CirceVersion = "0.14.1"
val AmmoniteVersion = "2.4.1"
val AmmoniteVersion = "2.5.0"
val ZeroturnaroundVersion = "1.14"

dependsOn(Projects.fuzzyc2cpg % Test, Projects.c2cpg % Test, Projects.macros)
Expand All @@ -21,6 +21,7 @@ libraryDependencies ++= Seq(
"io.circe" %% "circe-parser" % CirceVersion,
"org.zeroturnaround" % "zt-zip" % ZeroturnaroundVersion,
"com.lihaoyi" %% "ammonite" % AmmoniteVersion cross CrossVersion.full,
"com.lihaoyi" %% "os-lib" % "0.8.0",
"com.lihaoyi" %% "cask" % CaskVersion,
"org.scalameta" %% "scalameta" % "4.4.31",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test,
Expand Down
2 changes: 1 addition & 1 deletion console/src/main/scala/io/joern/console/BridgeBase.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.joern.console

import ammonite.ops.{Path, pwd}
import os.{Path, pwd}
import ammonite.util.{Colors, Res}
import better.files._
import io.joern.console.cpgqlserver.CPGQLServer
Expand Down
16 changes: 13 additions & 3 deletions console/src/main/scala/io/joern/console/PPrinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ object pprinter {
width: Int = defaultWidth,
height: Int = defaultHeight,
indent: Int = defaultIndent,
initialOffset: Int = 0
initialOffset: Int = 0,
escapeUnicode: Boolean,
showFieldNames: Boolean
): Iterator[fansi.Str] = {
val tree = this.treeify(x)
val tree = this.treeify(x, escapeUnicode = escapeUnicode, showFieldNames = showFieldNames)
val renderer = new Renderer(width, colorApplyPrefix, colorLiteral, indent) {
override def rec(x: Tree, leftOffset: Int, indentCount: Int): Result = x match {
case Tree.Literal(body) if isAnsiEncoded(body) =>
Expand All @@ -50,7 +52,15 @@ object pprinter {
Tree.Apply(
node.productPrefix,
Iterator.range(0, node.productArity).map { n =>
Tree.Infix(Tree.Literal(node.productElementLabel(n)), "->", original.treeify(node.productElement(n)))
Tree.Infix(
Tree.Literal(node.productElementLabel(n)),
"->",
original.treeify(
node.productElement(n),
escapeUnicode = original.defaultEscapeUnicode,
showFieldNames = original.defaultShowFieldNames
)
)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import better.files.Dsl._
import better.files._
import io.joern.console.workspacehandling.Project

import java.nio.file.FileSystemException
import scala.util.{Failure, Success, Try}
import scala.util.Try

package object testing {

Expand Down

0 comments on commit 31265ad

Please sign in to comment.