From 8d433f73e63d2d239dc099ffcab4f7c918d05675 Mon Sep 17 00:00:00 2001 From: xerial-bot Date: Sat, 28 Oct 2023 21:53:26 -0700 Subject: [PATCH] Update scalafmt-core to 3.7.15 (#3254) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## About this PR 📦 Updates [org.scalameta:scalafmt-core](https://github.com/scalameta/scalafmt) from `3.7.14` to `3.7.15` 📜 [GitHub Release Notes](https://github.com/scalameta/scalafmt/releases/tag/v3.7.15) - [Version Diff](https://github.com/scalameta/scalafmt/compare/v3.7.14...v3.7.15) ## Usage ✅ **Please merge!** I'll automatically update this PR to resolve conflicts as long as you don't change it yourself. If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below. Configure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/b83aae55d9dd000548c3b3c9b63d79636e7b3c8b/docs/repo-specific-configuration.md) file. _Have a fantastic day writing Scala!_
âš™ Adjust future updates Add this to your `.scala-steward.conf` file to ignore future updates of this dependency: ``` updates.ignore = [ { groupId = "org.scalameta", artifactId = "scalafmt-core" } ] ``` Or, add this to slow down future updates of this dependency: ``` dependencyOverrides = [{ pullRequests = { frequency = "30 days" }, dependency = { groupId = "org.scalameta", artifactId = "scalafmt-core" } }] ```
labels: library-update --------- Co-authored-by: Taro L. Saito --- .git-blame-ignore-revs | 3 +++ .scalafmt.conf | 2 +- .../src/main/scala/dotty/test/DITest.scala | 2 +- .../main/scala/dotty/test/Surface3Test.scala | 27 +++++++++---------- .../airframe/msgpack/spi/MessageFormat.scala | 2 +- .../scala/wvlet/airframe/AirframeSpec.scala | 2 +- airspec/build.sbt | 3 ++- .../wvlet/airspec/AirSpecSpiCompat.scala | 16 +++++------ .../main/scala/greeter/api/GreeterApi.scala | 2 +- .../src/main/scala/greeter/GreeterMain.scala | 2 +- .../src/main/scala/example/api/HelloApi.scala | 2 +- .../scala/example/server/ServerMain.scala | 2 +- .../src/main/scala/example/ui/ExampleUI.scala | 6 ++--- .../gallery/src/main/scala/Gallery.scala | 18 ++++++------- .../sbt/http/AirframeHttpPlugin.scala | 12 ++++----- .../main/scala/myapp/server/MyServer.scala | 4 +-- .../spi/src/main/scala/myapp/spi/MyRPC.scala | 4 +-- .../src/main/scala/myapp/spi/MyService.scala | 2 +- .../main/scala/example/api/GreeterApi.scala | 2 +- .../scala/example/api/GreeterApiTest.scala | 6 ++--- .../src/main/scala/myspp/client/Main.scala | 4 +-- .../src/main/scala/myspp/spi/MyService.scala | 4 +-- .../main/scala/example/api/RPCExample.scala | 4 +-- .../src/main/scala/example/api/MyRPCApi.scala | 4 +-- .../sbt-airframe/rpc-finagle/build.sbt | 5 +++- .../src/test/scala/example/MyRPCTest.scala | 4 +-- .../src/main/scala/example/api/MyRPCApi.scala | 4 +-- .../src/test/scala/example/MyRPCTest.scala | 2 +- .../src/test/scala/example/MyService.scala | 2 +- 29 files changed, 79 insertions(+), 73 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 8315045aaf..e70a7afa8c 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -6,3 +6,6 @@ fadb726e4d1855de746b61ed1bd3bb229f7e3f95 # Scala Steward: Reformat with scalafmt 3.7.5 6fc8adf4498d80bb3a9fcd8673b82cac985a4b00 + +# Scala Steward: Reformat with scalafmt 3.7.15 +378dadaf4b2e49d8db41e310e67c82e4162edc5d diff --git a/.scalafmt.conf b/.scalafmt.conf index 452be0eaad..4917c93899 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.7.14 +version = 3.7.15 project.layout = StandardConvention runner.dialect = scala3 maxColumn = 120 diff --git a/airframe-dotty-test/src/main/scala/dotty/test/DITest.scala b/airframe-dotty-test/src/main/scala/dotty/test/DITest.scala index 7c5720ef46..ea760b4313 100644 --- a/airframe-dotty-test/src/main/scala/dotty/test/DITest.scala +++ b/airframe-dotty-test/src/main/scala/dotty/test/DITest.scala @@ -1,7 +1,7 @@ package dotty.test import wvlet.log.{LogFormatter, LogLevel, LogSupport, Logger} -import wvlet.airframe._ +import wvlet.airframe.* import wvlet.airframe.surface.Surface object DITest extends LogSupport { diff --git a/airframe-dotty-test/src/main/scala/dotty/test/Surface3Test.scala b/airframe-dotty-test/src/main/scala/dotty/test/Surface3Test.scala index a71218a90f..20b9528c21 100644 --- a/airframe-dotty-test/src/main/scala/dotty/test/Surface3Test.scala +++ b/airframe-dotty-test/src/main/scala/dotty/test/Surface3Test.scala @@ -2,33 +2,33 @@ package dotty.test import wvlet.airframe.surface.Surface import wvlet.log.LogSupport -import wvlet.airframe.surface.tag._ +import wvlet.airframe.surface.tag.* object Surface3Test extends LogSupport { - import scala.quoted._ + import scala.quoted.* - inline def test(s:Surface, expected: String): Unit = { + inline def test(s: Surface, expected: String): Unit = { s match { case null => warn(s"Surface: expected: ${expected}, but null") case _ => val str = s.toString // info(s"${s}: ${s.getClass}") - if(str != expected) { + if (str != expected) { warn(s"Surface: expected: ${expected}, but ${str}") } } } inline def assert(v: Any, expected: Any): Unit = { - if(v != expected) { + if (v != expected) { warn(s"Expected: ${expected}, but ${v}") } } - case class Person(id:Int = -1, name:String) + case class Person(id: Int = -1, name: String) - trait Label + trait Label type MyString = String trait Holder[M[_]] { @@ -38,8 +38,8 @@ object Surface3Test extends LogSupport { trait Task[A] class Hello { - def hello(msg:String): String = msg - private def hiddemMethod: Int = 1 + def hello(msg: String): String = msg + private def hiddemMethod: Int = 1 protected def hiddenMethod2: Option[Int] = None } @@ -47,9 +47,9 @@ object Surface3Test extends LogSupport { def hello2: String = "hello2" } - case class MyOpt(a:Option[String]) + case class MyOpt(a: Option[String]) - def run:Unit = { + def run: Unit = { test(Surface.of[Int], "Int") test(Surface.of[Boolean], "Boolean") test(Surface.of[Long], "Long") @@ -84,7 +84,7 @@ object Surface3Test extends LogSupport { // Case class surface tests val s = Surface.of[Person] assert(s.params.mkString(","), "id:Int,name:String") - val p = Person(1, "leo") + val p = Person(1, "leo") val p0 = s.params(0) assert(p0.name, "id") assert(p0.getDefaultValue, Some(-1)) @@ -94,7 +94,7 @@ object Surface3Test extends LogSupport { val ms = Surface.methodsOf[Hello] debug(ms) - val h = new Hello + val h = new Hello val res = ms(0).call(h, "hello surface") assert(res, "hello surface") @@ -109,5 +109,4 @@ object Surface3Test extends LogSupport { info(sc.params) } - } diff --git a/airframe-msgpack/src/main/scala/wvlet/airframe/msgpack/spi/MessageFormat.scala b/airframe-msgpack/src/main/scala/wvlet/airframe/msgpack/spi/MessageFormat.scala index 920e903097..28145b2eec 100644 --- a/airframe-msgpack/src/main/scala/wvlet/airframe/msgpack/spi/MessageFormat.scala +++ b/airframe-msgpack/src/main/scala/wvlet/airframe/msgpack/spi/MessageFormat.scala @@ -84,7 +84,7 @@ object MessageFormat { def of(code: Byte): MessageFormat = formatTable(code & 0xff) /** - * Converting a byte value into MessageFormat. For faster performance, use {@link #valueOf} + * Converting a byte value into MessageFormat. For faster performance, use [[valueOf(byte)]] instead. * * @param b * MessageFormat of the given byte diff --git a/airframe-scalatest/shared/src/main/scala/wvlet/airframe/AirframeSpec.scala b/airframe-scalatest/shared/src/main/scala/wvlet/airframe/AirframeSpec.scala index 9a15fa5444..d3959183b2 100644 --- a/airframe-scalatest/shared/src/main/scala/wvlet/airframe/AirframeSpec.scala +++ b/airframe-scalatest/shared/src/main/scala/wvlet/airframe/AirframeSpec.scala @@ -13,7 +13,7 @@ */ package wvlet.airframe -import org.scalatest._ +import org.scalatest.* import wvlet.log.LogFormatter.SourceCodeLogFormatter import wvlet.log.{LogSupport, Logger} diff --git a/airspec/build.sbt b/airspec/build.sbt index 982996ce34..175411122b 100644 --- a/airspec/build.sbt +++ b/airspec/build.sbt @@ -130,7 +130,8 @@ def excludePomDependency(excludes: Seq[String]) = { node: XmlNode => }).transform(node).head } -/** AirSpec build definitions. +/** + * AirSpec build definitions. * * To make AirSpec a standalone library without any cyclic project references, AirSpec embeds the source code of * airframe-log, di, surface, etc. diff --git a/airspec/src/main/scala-3/wvlet/airspec/AirSpecSpiCompat.scala b/airspec/src/main/scala-3/wvlet/airspec/AirSpecSpiCompat.scala index 0f2a666fd4..5bbb426620 100644 --- a/airspec/src/main/scala-3/wvlet/airspec/AirSpecSpiCompat.scala +++ b/airspec/src/main/scala-3/wvlet/airspec/AirSpecSpiCompat.scala @@ -73,11 +73,11 @@ object AirSpecTestBuilder extends wvlet.log.LogSupport { } private[airspec] object AirSpecMacros { - import scala.quoted._ + import scala.quoted.* def test0Impl[R](self: Expr[AirSpecTestBuilder], body: Expr[R])(using Type[R], Quotes): Expr[Unit] = { '{ - import AirSpecTestBuilder._ + import AirSpecTestBuilder.* ${ self }.addF0(LazyF0(${ body })) } } @@ -93,12 +93,12 @@ private[airspec] object AirSpecMacros { // Nil or Seq[_], Scala 3 complier passes Function1[Int, R] as a body even if the code block take no argument. case '{ $x: t } if TypeRepr.of[t] =:= TypeRepr.of[Nil.type] || TypeRepr.of[t] <:< TypeRepr.of[Seq[_]] => '{ - import AirSpecTestBuilder._ + import AirSpecTestBuilder.* ${ self }.addF0(LazyF0.apply(${ body })) } case _ => '{ - import AirSpecTestBuilder._ + import AirSpecTestBuilder.* ${ self }.addF1(Surface.of[D1], ${ body }) } } @@ -109,7 +109,7 @@ private[airspec] object AirSpecMacros { body: Expr[(D1, D2) => R] )(using Type[D1], Type[D2], Type[R], Quotes): Expr[Unit] = { '{ - import AirSpecTestBuilder._ + import AirSpecTestBuilder.* ${ self }.addF2(Surface.of[D1], Surface.of[D2], ${ body }) } } @@ -119,7 +119,7 @@ private[airspec] object AirSpecMacros { body: Expr[(D1, D2, D3) => R] )(using Type[D1], Type[D2], Type[D3], Type[R], Quotes): Expr[Unit] = { '{ - import AirSpecTestBuilder._ + import AirSpecTestBuilder.* ${ self }.addF3(Surface.of[D1], Surface.of[D2], Surface.of[D3], ${ body }) } } @@ -129,7 +129,7 @@ private[airspec] object AirSpecMacros { body: Expr[(D1, D2, D3, D4) => R] )(using Type[D1], Type[D2], Type[D3], Type[D4], Type[R], Quotes): Expr[Unit] = { '{ - import AirSpecTestBuilder._ + import AirSpecTestBuilder.* ${ self }.addF4(Surface.of[D1], Surface.of[D2], Surface.of[D3], Surface.of[D4], ${ body }) } } @@ -139,7 +139,7 @@ private[airspec] object AirSpecMacros { body: Expr[(D1, D2, D3, D4, D5) => R] )(using Type[D1], Type[D2], Type[D3], Type[D4], Type[D5], Type[R], Quotes): Expr[Unit] = { '{ - import AirSpecTestBuilder._ + import AirSpecTestBuilder.* ${ self }.addF5( Surface.of[D1], Surface.of[D2], diff --git a/examples/rpc-examples/hello-rpc/api/src/main/scala/greeter/api/GreeterApi.scala b/examples/rpc-examples/hello-rpc/api/src/main/scala/greeter/api/GreeterApi.scala index b6c7d20d2f..02eb6848a3 100644 --- a/examples/rpc-examples/hello-rpc/api/src/main/scala/greeter/api/GreeterApi.scala +++ b/examples/rpc-examples/hello-rpc/api/src/main/scala/greeter/api/GreeterApi.scala @@ -1,6 +1,6 @@ package greeter.api -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.log.LogSupport @RPC diff --git a/examples/rpc-examples/hello-rpc/src/main/scala/greeter/GreeterMain.scala b/examples/rpc-examples/hello-rpc/src/main/scala/greeter/GreeterMain.scala index 4aea56f545..5b5174e3aa 100644 --- a/examples/rpc-examples/hello-rpc/src/main/scala/greeter/GreeterMain.scala +++ b/examples/rpc-examples/hello-rpc/src/main/scala/greeter/GreeterMain.scala @@ -14,7 +14,7 @@ package greeter import greeter.api.{GreeterApi, GreeterRPC} -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.airframe.http.netty.Netty import wvlet.airframe.launcher.{Launcher, command, option} import wvlet.log.{LogSupport, Logger} diff --git a/examples/rpc-examples/rpc-scalajs/api/src/main/scala/example/api/HelloApi.scala b/examples/rpc-examples/rpc-scalajs/api/src/main/scala/example/api/HelloApi.scala index 98be3f586a..89d98a81a5 100644 --- a/examples/rpc-examples/rpc-scalajs/api/src/main/scala/example/api/HelloApi.scala +++ b/examples/rpc-examples/rpc-scalajs/api/src/main/scala/example/api/HelloApi.scala @@ -13,7 +13,7 @@ t * See the License for the specific language governing permissions and */ package example.api -import wvlet.airframe.http._ +import wvlet.airframe.http.* @RPC trait HelloApi { diff --git a/examples/rpc-examples/rpc-scalajs/server/src/main/scala/example/server/ServerMain.scala b/examples/rpc-examples/rpc-scalajs/server/src/main/scala/example/server/ServerMain.scala index 0dea4de276..cc4729e2bd 100644 --- a/examples/rpc-examples/rpc-scalajs/server/src/main/scala/example/server/ServerMain.scala +++ b/examples/rpc-examples/rpc-scalajs/server/src/main/scala/example/server/ServerMain.scala @@ -13,7 +13,7 @@ */ package example.server -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.airframe.launcher.{Launcher, command, option} import wvlet.log.{LogSupport, Logger} import wvlet.airframe.http.netty.{Netty, NettyServer} diff --git a/examples/rpc-examples/rpc-scalajs/ui/src/main/scala/example/ui/ExampleUI.scala b/examples/rpc-examples/rpc-scalajs/ui/src/main/scala/example/ui/ExampleUI.scala index 6f7138dcc4..b02e864aca 100644 --- a/examples/rpc-examples/rpc-scalajs/ui/src/main/scala/example/ui/ExampleUI.scala +++ b/examples/rpc-examples/rpc-scalajs/ui/src/main/scala/example/ui/ExampleUI.scala @@ -16,13 +16,13 @@ package example.ui import example.api.ServiceRPC import org.scalajs.dom import org.scalajs.dom.MouseEvent -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.airframe.rx.{Rx, RxOption} import wvlet.airframe.rx.html.{DOMRenderer, RxElement} import scala.scalajs.js.annotation.JSExport -import wvlet.airframe.rx.html._ -import wvlet.airframe.rx.html.all._ +import wvlet.airframe.rx.html.* +import wvlet.airframe.rx.html.all.* import wvlet.log.{LogLevel, LogSupport, Logger} /** diff --git a/examples/rx-demo/gallery/src/main/scala/Gallery.scala b/examples/rx-demo/gallery/src/main/scala/Gallery.scala index 81329e4d1d..dc0e2a15b3 100644 --- a/examples/rx-demo/gallery/src/main/scala/Gallery.scala +++ b/examples/rx-demo/gallery/src/main/scala/Gallery.scala @@ -16,7 +16,7 @@ package wvlet.airframe.rx.html.widget.demo import org.scalajs.dom import org.scalajs.dom.document import wvlet.airframe.rx.Rx -import wvlet.airframe.rx.html.all._ +import wvlet.airframe.rx.html.all.* import wvlet.airframe.rx.html.{DOMRenderer, RxCode, RxComponent, RxElement, tags} import wvlet.airframe.rx.html.HtmlCompat.extractCode import wvlet.log.{LogLevel, LogSupport, Logger} @@ -125,7 +125,7 @@ object Gallery extends LogSupport { def buttonSmallDemo: Example = Example( "Small buttons", extractCode { - import wvlet.airframe.rx.html.all._ + import wvlet.airframe.rx.html.all.* def smallButton(style: String) = button(tpe -> "button", cls -> s"btn btn-sm btn-${style}", style) @@ -196,7 +196,7 @@ object Gallery extends LogSupport { // Creating a new canvas val c = newCanvas(50, 50) - import c._ + import c.* context.fillStyle = "#99CCFF" context.fillRect(0, 0, c.canvas.width, c.canvas.height) context.strokeStyle = "#336699" @@ -210,8 +210,8 @@ object Gallery extends LogSupport { def svgDemo = Example( "SVG", extractCode { - import wvlet.airframe.rx.html.svgAttrs._ - import wvlet.airframe.rx.html.svgTags._ + import wvlet.airframe.rx.html.svgAttrs.* + import wvlet.airframe.rx.html.svgTags.* val circleColor = Rx.variable("white") @@ -245,7 +245,7 @@ object Gallery extends LogSupport { def elementGallery = Example( "RxElement", extractCode { - import wvlet.airframe.rx.html.all._ + import wvlet.airframe.rx.html.all.* class MyButton(name: String) extends RxElement { def render: RxElement = button(cls -> "btn btn-outline-primary", name) @@ -258,7 +258,7 @@ object Gallery extends LogSupport { def customElementGallery = Example( "Customize RxElement", extractCode { - import wvlet.airframe.rx.html.all._ + import wvlet.airframe.rx.html.all.* def myButton = button(cls -> "btn btn-outline-primary") @@ -270,7 +270,7 @@ object Gallery extends LogSupport { def componentGallery = Example( "RxComponent", extractCode { - import wvlet.airframe.rx.html.all._ + import wvlet.airframe.rx.html.all.* // RxComponent is the unit of a reactive widget that can enclose other components or elements. class MyComponent extends RxComponent { @@ -285,7 +285,7 @@ object Gallery extends LogSupport { def timer = Example( "Timer", extractCode { - import wvlet.airframe.rx.html.all._ + import wvlet.airframe.rx.html.all.* var i = 0 // Run the code every 1 second (1000 milliseconds) diff --git a/sbt-airframe/src/main/scala/wvlet/airframe/sbt/http/AirframeHttpPlugin.scala b/sbt-airframe/src/main/scala/wvlet/airframe/sbt/http/AirframeHttpPlugin.scala index 47c52cac58..0135b53cd2 100644 --- a/sbt-airframe/src/main/scala/wvlet/airframe/sbt/http/AirframeHttpPlugin.scala +++ b/sbt-airframe/src/main/scala/wvlet/airframe/sbt/http/AirframeHttpPlugin.scala @@ -16,17 +16,17 @@ package wvlet.airframe.sbt.http import java.io.{File, FileInputStream} import java.nio.file.Files import java.util.zip.GZIPInputStream -import coursier._ +import coursier.* import coursier.core.Extension import org.apache.commons.compress.archivers.tar.TarArchiveInputStream import org.apache.commons.compress.utils.IOUtils -import sbt._ +import sbt.* import wvlet.airframe.codec.MessageCodec import wvlet.airframe.control.OS import wvlet.log.LogSupport import wvlet.log.io.IOUtil.withResource -import scala.sys.process._ +import scala.sys.process.* /** * sbt plugin for supporting Airframe HTTP development. @@ -43,7 +43,7 @@ object AirframeHttpPlugin extends AutoPlugin with LogSupport { object autoImport extends Keys - import autoImport._ + import autoImport.* override def requires: Plugins = sbt.plugins.JvmPlugin override def trigger = noTrigger @@ -90,7 +90,7 @@ object AirframeHttpPlugin extends AutoPlugin with LogSupport { private val cacheFileName = "generated.cache" def httpProjectSettings = { - import sbt.Keys._ + import sbt.Keys.* Seq( airframeHttpClients := Seq.empty, airframeHttpClasspass := { @@ -127,7 +127,7 @@ object AirframeHttpPlugin extends AutoPlugin with LogSupport { if (needsUpdate) { // Download airframe-http.tgz with coursier - import coursier._ + import coursier.* val moduleName = s"airframe-http-codegen_${scalaBinaryVersion.value}" val d = Dependency( diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/server/src/main/scala/myapp/server/MyServer.scala b/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/server/src/main/scala/myapp/server/MyServer.scala index 524a006a2f..567f175ecd 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/server/src/main/scala/myapp/server/MyServer.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/server/src/main/scala/myapp/server/MyServer.scala @@ -1,11 +1,11 @@ package myapp.server -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.airframe.http.client.SyncClient import wvlet.airframe.http.netty.Netty import wvlet.log.LogSupport import myapp.spi.MyService -import myapp.spi.MyRPC._ +import myapp.spi.MyRPC.* class MyServiceImpl extends myapp.spi.MyService { override def hello(id: Int): String = s"hello ${id}" diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyRPC.scala b/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyRPC.scala index 10dcbe37fa..e06ab82777 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyRPC.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyRPC.scala @@ -1,10 +1,10 @@ package myapp.spi -import wvlet.airframe.http._ +import wvlet.airframe.http.* @RPC trait MyRPC { - import MyRPC._ + import MyRPC.* def world(): World def addEntry(id: Int, name: String): String diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyService.scala b/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyService.scala index 67804f484d..6dd74e73e9 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyService.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/generate-client/spi/src/main/scala/myapp/spi/MyService.scala @@ -1,6 +1,6 @@ package myapp.spi -import wvlet.airframe.http._ +import wvlet.airframe.http.* trait MyService { @Endpoint(method = HttpMethod.GET, path = "/v1/hello/:id") diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/grpc/api/src/main/scala/example/api/GreeterApi.scala b/sbt-airframe/src/sbt-test/sbt-airframe/grpc/api/src/main/scala/example/api/GreeterApi.scala index f373ab004d..e3aef72b20 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/grpc/api/src/main/scala/example/api/GreeterApi.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/grpc/api/src/main/scala/example/api/GreeterApi.scala @@ -1,6 +1,6 @@ package example.api -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.airframe.rx.Rx @RPC diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/grpc/server/src/test/scala/example/api/GreeterApiTest.scala b/sbt-airframe/src/sbt-test/sbt-airframe/grpc/server/src/test/scala/example/api/GreeterApiTest.scala index 3813c7d25b..7f667e58d1 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/grpc/server/src/test/scala/example/api/GreeterApiTest.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/grpc/server/src/test/scala/example/api/GreeterApiTest.scala @@ -1,9 +1,9 @@ package example.api -import wvlet.airspec._ -import wvlet.airframe._ +import wvlet.airspec.* +import wvlet.airframe.* import wvlet.airframe.rx.Rx -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.airframe.http.grpc.gRPC import wvlet.airframe.http.grpc.GrpcServer import io.grpc.ManagedChannelBuilder diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/js-client/client/src/main/scala/myspp/client/Main.scala b/sbt-airframe/src/sbt-test/sbt-airframe/js-client/client/src/main/scala/myspp/client/Main.scala index 1ab4ed97a6..29e84f2073 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/js-client/client/src/main/scala/myspp/client/Main.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/js-client/client/src/main/scala/myspp/client/Main.scala @@ -1,13 +1,13 @@ package myapp.client -import myapp.spi._ +import myapp.spi.* import wvlet.airframe.http.Http object Main { val rpcClient = ServiceRPC.newRPCAsyncClient(Http.client.newJSClient) - import MyRPC._ + import MyRPC.* // RPC client that returns Rx[X] type rpcClient.MyRPC.hello(System.currentTimeMillis(), HelloRequest()).run { case x => diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/js-client/spi/src/main/scala/myspp/spi/MyService.scala b/sbt-airframe/src/sbt-test/sbt-airframe/js-client/spi/src/main/scala/myspp/spi/MyService.scala index 14fd5b6a0f..f60eb64927 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/js-client/spi/src/main/scala/myspp/spi/MyService.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/js-client/spi/src/main/scala/myspp/spi/MyService.scala @@ -13,11 +13,11 @@ */ package myapp.spi -import wvlet.airframe.http._ +import wvlet.airframe.http.* @RPC trait MyRPC { - import MyRPC._ + import MyRPC.* def hello(time: Long, request: HelloRequest): String } diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/openapi/src/main/scala/example/api/RPCExample.scala b/sbt-airframe/src/sbt-test/sbt-airframe/openapi/src/main/scala/example/api/RPCExample.scala index 96145f4ccc..9883e15db5 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/openapi/src/main/scala/example/api/RPCExample.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/openapi/src/main/scala/example/api/RPCExample.scala @@ -12,13 +12,13 @@ * limitations under the License. */ package example.api -import wvlet.airframe.http._ +import wvlet.airframe.http.* /** */ @RPC trait OpenAPIRPCExample { - import OpenAPIRPCExample._ + import OpenAPIRPCExample.* def zeroAryRPC: Unit def rpcWithPrimitive(p1: Int): Int diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/api/src/main/scala/example/api/MyRPCApi.scala b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/api/src/main/scala/example/api/MyRPCApi.scala index 8bacdc764c..c8ac0f765b 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/api/src/main/scala/example/api/MyRPCApi.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/api/src/main/scala/example/api/MyRPCApi.scala @@ -1,11 +1,11 @@ package example.api -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.log.LogSupport @RPC trait MyRPCApi extends LogSupport { - import MyRPCApi._ + import MyRPCApi.* def helloRPC(request: HelloRequest): HelloResponse = { val message = s"Hello ${request.name}!" HelloResponse(message) diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/build.sbt b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/build.sbt index 157c0d9c5e..ac75675788 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/build.sbt +++ b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/build.sbt @@ -11,7 +11,10 @@ val AIRSPEC_VERSION = sys.props("airspec.version") val buildSettings: Seq[Def.Setting[_]] = Seq( testFrameworks += new TestFramework("wvlet.airspec.Framework"), - libraryDependencies += "org.wvlet.airframe" %% "airspec" % AIRSPEC_VERSION % Test + libraryDependencies += "org.wvlet.airframe" %% "airspec" % AIRSPEC_VERSION % Test, + scalacOptions ++= Seq( + "-Xsource:3" + ) ) lazy val root = diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/server/src/test/scala/example/MyRPCTest.scala b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/server/src/test/scala/example/MyRPCTest.scala index 87dd9c02bb..e3145ec092 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/server/src/test/scala/example/MyRPCTest.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-finagle/server/src/test/scala/example/MyRPCTest.scala @@ -1,8 +1,8 @@ package example import wvlet.airspec.AirSpec -import wvlet.airframe._ -import wvlet.airframe.http._ +import wvlet.airframe.* +import wvlet.airframe.http.* import wvlet.airframe.http.finagle.{Finagle, FinagleServer} import example.api.MyRPCApi import example.api.MyRPCApi.{HelloRequest, HelloResponse} diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/api/src/main/scala/example/api/MyRPCApi.scala b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/api/src/main/scala/example/api/MyRPCApi.scala index b87f7a587b..c723672628 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/api/src/main/scala/example/api/MyRPCApi.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/api/src/main/scala/example/api/MyRPCApi.scala @@ -1,11 +1,11 @@ package example.api -import wvlet.airframe.http._ +import wvlet.airframe.http.* import wvlet.log.LogSupport @RPC class MyRPCApi extends LogSupport { - import MyRPCApi._ + import MyRPCApi.* def helloRPC(request: HelloRequest): HelloResponse = { val message = s"Hello ${request.name}!" HelloResponse(message) diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/server/src/test/scala/example/MyRPCTest.scala b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/server/src/test/scala/example/MyRPCTest.scala index 436816fe75..032b67445c 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/server/src/test/scala/example/MyRPCTest.scala +++ b/sbt-airframe/src/sbt-test/sbt-airframe/rpc-netty/server/src/test/scala/example/MyRPCTest.scala @@ -1,7 +1,7 @@ package example import wvlet.airspec.AirSpec -import wvlet.airframe._ +import wvlet.airframe.* import wvlet.airframe.http.Http import wvlet.airframe.http.netty.{Netty, NettyServer} import example.api.MyRPCApi diff --git a/sbt-airframe/src/test/scala/example/MyService.scala b/sbt-airframe/src/test/scala/example/MyService.scala index cdb4d0c4a9..080fbb09ea 100644 --- a/sbt-airframe/src/test/scala/example/MyService.scala +++ b/sbt-airframe/src/test/scala/example/MyService.scala @@ -14,7 +14,7 @@ package example import java.util.UUID -import wvlet.airframe.http._ +import wvlet.airframe.http.* import scala.concurrent.Future