From 91483b672a9c31a558ccda809aab36be954111b1 Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Tue, 9 Jul 2024 09:40:15 +0100 Subject: [PATCH] scalafmt Signed-off-by: Prabhu Subramanian --- .../io/appthreat/console/ConsoleTests.scala | 4 ++-- .../console/LanguageHelperTests.scala | 4 ++-- .../console/PluginManagerTests.scala | 4 ++-- .../appthreat/console/testing/package.scala | 4 ++-- .../console/QueryDatabaseTests.scala | 2 +- .../io/appthreat/macros/QueryMacroTests.scala | 4 ++-- platform/build.sbt | 2 +- platform/frontends/javasrc2cpg/build.sbt | 2 +- .../chencli/console/Predefined.scala | 20 +++++++++---------- project/FileUtils.scala | 2 +- project/Projects.scala | 2 +- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/console/src/test/scala/io/appthreat/console/ConsoleTests.scala b/console/src/test/scala/io/appthreat/console/ConsoleTests.scala index 25f98796..165399ca 100644 --- a/console/src/test/scala/io/appthreat/console/ConsoleTests.scala +++ b/console/src/test/scala/io/appthreat/console/ConsoleTests.scala @@ -1,7 +1,7 @@ package io.appthreat.console -import better.files.Dsl._ -import better.files._ +import better.files.Dsl.* +import better.files.* import io.appthreat.console.testing._ import io.appthreat.x2cpg.X2Cpg.defaultOverlayCreators import io.appthreat.x2cpg.layers.{Base, CallGraph, ControlFlow, TypeRelations} diff --git a/console/src/test/scala/io/appthreat/console/LanguageHelperTests.scala b/console/src/test/scala/io/appthreat/console/LanguageHelperTests.scala index d06d22b1..ce2994be 100644 --- a/console/src/test/scala/io/appthreat/console/LanguageHelperTests.scala +++ b/console/src/test/scala/io/appthreat/console/LanguageHelperTests.scala @@ -1,7 +1,7 @@ package io.appthreat.console -import better.files.Dsl._ -import better.files._ +import better.files.Dsl.* +import better.files.* import io.shiftleft.codepropertygraph.generated.Languages import io.appthreat.console.cpgcreation.guessLanguage import org.scalatest.matchers.should.Matchers diff --git a/console/src/test/scala/io/appthreat/console/PluginManagerTests.scala b/console/src/test/scala/io/appthreat/console/PluginManagerTests.scala index e0fdd8b0..41c5bc2f 100644 --- a/console/src/test/scala/io/appthreat/console/PluginManagerTests.scala +++ b/console/src/test/scala/io/appthreat/console/PluginManagerTests.scala @@ -1,7 +1,7 @@ package io.appthreat.console -import better.files.Dsl._ -import better.files._ +import better.files.Dsl.* +import better.files.* import io.shiftleft.utils.ProjectRoot import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/console/src/test/scala/io/appthreat/console/testing/package.scala b/console/src/test/scala/io/appthreat/console/testing/package.scala index 8bf64139..f0287dec 100644 --- a/console/src/test/scala/io/appthreat/console/testing/package.scala +++ b/console/src/test/scala/io/appthreat/console/testing/package.scala @@ -1,7 +1,7 @@ package io.appthreat.console -import better.files.Dsl._ -import better.files._ +import better.files.Dsl.* +import better.files.* import io.appthreat.console.workspacehandling.Project import scala.util.Try diff --git a/macros/src/test/scala/io/appthreat/console/QueryDatabaseTests.scala b/macros/src/test/scala/io/appthreat/console/QueryDatabaseTests.scala index b715722b..aa9fcfcf 100644 --- a/macros/src/test/scala/io/appthreat/console/QueryDatabaseTests.scala +++ b/macros/src/test/scala/io/appthreat/console/QueryDatabaseTests.scala @@ -1,7 +1,7 @@ package io.appthreat.console import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpec diff --git a/macros/src/test/scala/io/appthreat/macros/QueryMacroTests.scala b/macros/src/test/scala/io/appthreat/macros/QueryMacroTests.scala index 134dd107..4bf94666 100644 --- a/macros/src/test/scala/io/appthreat/macros/QueryMacroTests.scala +++ b/macros/src/test/scala/io/appthreat/macros/QueryMacroTests.scala @@ -4,8 +4,8 @@ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import QueryMacros.withStrRep -import io.appthreat.console._ -import io.shiftleft.semanticcpg.language._ +import io.appthreat.console.* +import io.shiftleft.semanticcpg.language.* class QueryMacroTests extends AnyWordSpec with Matchers { "Query macros" should { diff --git a/platform/build.sbt b/platform/build.sbt index bd1115cd..6e5c09af 100644 --- a/platform/build.sbt +++ b/platform/build.sbt @@ -53,7 +53,7 @@ Universal / mappings += cpgVersionFile.value -> "schema-extender/cpg-version" lazy val generateScaladocs = taskKey[File]("generate scaladocs from combined project sources") generateScaladocs := { - import better.files._ + import better.files.* import java.io.{File => JFile, PrintWriter} import sbt.internal.inc.AnalyzingCompiler import sbt.internal.util.Attributed.data diff --git a/platform/frontends/javasrc2cpg/build.sbt b/platform/frontends/javasrc2cpg/build.sbt index bf83efb5..07ef0350 100644 --- a/platform/frontends/javasrc2cpg/build.sbt +++ b/platform/frontends/javasrc2cpg/build.sbt @@ -19,7 +19,7 @@ Global / onChangedBuildSource := ReloadOnSourceChanges lazy val packTestCode = taskKey[Unit]("Packs test code for JarTypeReader into jars.") packTestCode := { - import better.files._ + import better.files.* import net.lingala.zip4j.ZipFile import net.lingala.zip4j.model.ZipParameters import net.lingala.zip4j.model.enums.{CompressionLevel, CompressionMethod} diff --git a/platform/src/main/scala/io/appthreat/chencli/console/Predefined.scala b/platform/src/main/scala/io/appthreat/chencli/console/Predefined.scala index 71678dba..4d3a81b8 100644 --- a/platform/src/main/scala/io/appthreat/chencli/console/Predefined.scala +++ b/platform/src/main/scala/io/appthreat/chencli/console/Predefined.scala @@ -6,21 +6,21 @@ object Predefined: val shared: Seq[String] = Seq( - "import _root_.io.appthreat.console._", - "import _root_.io.appthreat.chencli.console.ChenConsole._", + "import _root_.io.appthreat.console.*", + "import _root_.io.appthreat.chencli.console.ChenConsole.*", "import _root_.io.appthreat.chencli.console.Chen.context", "import _root_.io.shiftleft.codepropertygraph.Cpg", "import _root_.io.shiftleft.codepropertygraph.Cpg.docSearchPackages", - "import _root_.io.shiftleft.codepropertygraph.cpgloading._", - "import _root_.io.shiftleft.codepropertygraph.generated._", - "import _root_.io.shiftleft.codepropertygraph.generated.nodes._", - "import _root_.io.shiftleft.codepropertygraph.generated.edges._", - "import _root_.io.appthreat.dataflowengineoss.language._", - "import _root_.io.shiftleft.semanticcpg.language._", - "import overflowdb._", + "import _root_.io.shiftleft.codepropertygraph.cpgloading.*", + "import _root_.io.shiftleft.codepropertygraph.generated.*", + "import _root_.io.shiftleft.codepropertygraph.generated.nodes.*", + "import _root_.io.shiftleft.codepropertygraph.generated.edges.*", + "import _root_.io.appthreat.dataflowengineoss.language.*", + "import _root_.io.shiftleft.semanticcpg.language.*", + "import overflowdb.*", "import overflowdb.traversal.{`package` => _, help => _, _}", "import overflowdb.traversal.help.Doc", - "import scala.jdk.CollectionConverters._", + "import scala.jdk.CollectionConverters.*", """ |@Doc(info = "Show reachable flows from a source to sink. Default source: framework-input and sink: framework-output", example = "reachables") |def reachables(sinkTag: String, sourceTag: String, sourceTags: Array[String])(implicit atom: Cpg): Unit = { diff --git a/project/FileUtils.scala b/project/FileUtils.scala index 13c04a9d..d4039208 100644 --- a/project/FileUtils.scala +++ b/project/FileUtils.scala @@ -1,6 +1,6 @@ import java.io.File import java.nio.file.Files -import scala.collection.JavaConverters._ +import scala.collection.JavaConverters.* object FileUtils { diff --git a/project/Projects.scala b/project/Projects.scala index 5c7da625..1a8d642c 100644 --- a/project/Projects.scala +++ b/project/Projects.scala @@ -1,4 +1,4 @@ -import sbt._ +import sbt.* object Projects { val frontendsRoot = file("platform/frontends")