Skip to content

Commit

Permalink
Merge pull request #11 from bartosz822/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies & fix issues after update
  • Loading branch information
xplosunn authored May 20, 2024
2 parents 37868be + 07e1156 commit d501967
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
28 changes: 14 additions & 14 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,35 @@ lazy val rules = project.settings(
)

lazy val input = project.settings(
skip in publish := true,
publish/skip := true,
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % "0.13.0",
"io.circe" %% "circe-literal" % "0.13.0",
"org.typelevel" %% "jawn-parser" % "1.0.0",
"io.circe" %% "circe-core" % "0.14.7",
"io.circe" %% "circe-literal" % "0.14.7",
"org.typelevel" %% "jawn-parser" % "1.5.1",
)
)

lazy val output = project.settings(
skip in publish := true,
publish/skip := true,
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % "0.13.0",
"io.circe" %% "circe-literal" % "0.13.0",
"org.typelevel" %% "jawn-parser" % "1.0.0",
"io.circe" %% "circe-core" % "0.14.7",
"io.circe" %% "circe-literal" % "0.14.7",
"org.typelevel" %% "jawn-parser" % "1.5.1",
)
)

lazy val tests = project
.settings(
skip in publish := true,
publish/skip := true,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full,
compile.in(Compile) :=
compile.in(Compile).dependsOn(compile.in(input, Compile)).value,
(Compile / compile) :=
(Compile/compile).dependsOn(input / Compile / compile).value,
scalafixTestkitOutputSourceDirectories :=
sourceDirectories.in(output, Compile).value,
(output/ Compile / sourceDirectories).value,
scalafixTestkitInputSourceDirectories :=
sourceDirectories.in(input, Compile).value,
(input / Compile /sourceDirectories).value,
scalafixTestkitInputClasspath :=
fullClasspath.in(input, Compile).value
(input / Compile/ fullClasspath).value
)
.dependsOn(rules)
.enablePlugins(ScalafixTestkitPlugin)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.1
sbt.version=1.9.9
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolvers += Resolver.sonatypeRepo("releases")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.33")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
6 changes: 5 additions & 1 deletion rules/src/main/scala/fix/JsonMacroFormatter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ class JsonMacroFormatter extends SemanticRule("fix.JsonMacroFormatter") {
def replaceReplacementStrings(json: Json): String = {
val formatted = indent(json.spaces2, t.pos.startColumn).trim
val newJson = terms.foldLeft(formatted)((str, term) =>
str.replaceFirstLiterally(("\"" + unlikelyToBeMatchedString + "\""), s"$${$term}")
str.replaceFirstLiterally(
("\"" + unlikelyToBeMatchedString + "\""),
if (term.toString().startsWith("{") && term.toString().endsWith("}")) s"$$$term"
else s"$${$term}",
)
)
newJson
}
Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/scala/fix/RuleSuite.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package fix

import org.scalatest.FunSpecLike
import org.scalatest.funsuite.AnyFunSuiteLike
import scalafix.testkit.AbstractSemanticRuleSuite

class RuleSuite extends AbstractSemanticRuleSuite with FunSpecLike {
class RuleSuite extends AbstractSemanticRuleSuite with AnyFunSuiteLike {
runAllTests()
}

0 comments on commit d501967

Please sign in to comment.