From d262151c4ca0da1f3c25629102744a6b83b94117 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Sun, 29 May 2022 09:50:29 +0200 Subject: [PATCH] deps: bump scalafmt to 3.5.7 Also make sure new jsdomtest modules has the correct scalacoptions for styleFix to run. --- .scalafmt.conf | 2 +- build.sbt | 3 +- .../scoverage/PluginASTSupportTest.scala | 52 ++++++++++--------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index e316d8ce..afb1bf7d 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.3.1" +version = "3.5.7" project.git = true runner.dialect = "scala213" assumeStandardLibraryStripMargin = true diff --git a/build.sbt b/build.sbt index b8a97768..06b40cf8 100644 --- a/build.sbt +++ b/build.sbt @@ -133,7 +133,8 @@ lazy val runtimeJSDOMTest = .settings( publishArtifact := false, publishLocal := {}, - jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv() + jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(), + sharedSettings ) lazy val plugin = diff --git a/plugin/src/test/scala/scoverage/PluginASTSupportTest.scala b/plugin/src/test/scala/scoverage/PluginASTSupportTest.scala index b48ee1cc..d504e050 100644 --- a/plugin/src/test/scala/scoverage/PluginASTSupportTest.scala +++ b/plugin/src/test/scala/scoverage/PluginASTSupportTest.scala @@ -93,31 +93,33 @@ class PluginASTSupportTest extends FunSuite with MacroSupport { test("scoverage component should ignore complex macros #11") { val compiler = ScoverageCompiler.default - compiler.compileCodeSnippet(s""" object ComplexMacro { - | - | import scala.language.experimental.macros - | import ${macroContextPackageName}.Context - | - | def debug(params: Any*): Unit = macro debugImpl - | - | def debugImpl(c: Context)(params: c.Expr[Any]*) = { - | import c.universe._ - | - | val trees = params map {param => (param.tree match { - | case Literal(Constant(_)) => reify { print(param.splice) } - | case _ => reify { - | val variable = c.Expr[String](Literal(Constant(show(param.tree)))).splice - | print(s"$$variable = $${param.splice}") - | } - | }).tree - | } - | - | val separators = (1 until trees.size).map(_ => (reify { print(", ") }).tree) :+ (reify { println() }).tree - | val treesWithSeparators = trees zip separators flatMap {p => List(p._1, p._2)} - | - | c.Expr[Unit](Block(treesWithSeparators.toList, Literal(Constant(())))) - | } - |} """.stripMargin) + compiler.compileCodeSnippet( + s""" object ComplexMacro { + | + | import scala.language.experimental.macros + | import ${macroContextPackageName}.Context + | + | def debug(params: Any*): Unit = macro debugImpl + | + | def debugImpl(c: Context)(params: c.Expr[Any]*) = { + | import c.universe._ + | + | val trees = params map {param => (param.tree match { + | case Literal(Constant(_)) => reify { print(param.splice) } + | case _ => reify { + | val variable = c.Expr[String](Literal(Constant(show(param.tree)))).splice + | print(s"$$variable = $${param.splice}") + | } + | }).tree + | } + | + | val separators = (1 until trees.size).map(_ => (reify { print(", ") }).tree) :+ (reify { println() }).tree + | val treesWithSeparators = trees zip separators flatMap {p => List(p._1, p._2)} + | + | c.Expr[Unit](Block(treesWithSeparators.toList, Literal(Constant(())))) + | } + |} """.stripMargin + ) assert(!compiler.reporter.hasErrors) }