diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 79123394a7..df54f9b3ba 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -18,3 +18,6 @@ fadb726e4d1855de746b61ed1bd3bb229f7e3f95 # Scala Steward: Reformat with scalafmt 3.8.3 6a75de98b210cf0cc9cd4bf8693ac80bf3ab32ab + +# Scala Steward: Reformat with scalafmt 3.8.4 +c94b1327f346ed0dddc374c7844aaa55080dc84f diff --git a/.scalafmt.conf b/.scalafmt.conf index e2602612a1..68a19db899 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.3 +version = 3.8.4 project.layout = StandardConvention runner.dialect = scala3 maxColumn = 120 diff --git a/airframe-core/.js/src/main/scala-3/wvlet/airframe/log/JSConsoleLogHandler.scala b/airframe-core/.js/src/main/scala-3/wvlet/airframe/log/JSConsoleLogHandler.scala index c909e0f9c4..58606150b3 100644 --- a/airframe-core/.js/src/main/scala-3/wvlet/airframe/log/JSConsoleLogHandler.scala +++ b/airframe-core/.js/src/main/scala-3/wvlet/airframe/log/JSConsoleLogHandler.scala @@ -1,6 +1,6 @@ package wvlet.airframe.log -import java.util.{logging as jl} +import java.util.logging as jl import wvlet.airframe.log.JSConsoleLogHandler.JSLogColorPalette diff --git a/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/io/IOUtil.scala b/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/io/IOUtil.scala index 370c5d8f75..6dd2e7d2da 100644 --- a/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/io/IOUtil.scala +++ b/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/io/IOUtil.scala @@ -43,11 +43,10 @@ object IOUtil: def findPath(path: File): Option[File] = if path.exists() then Some(path) - else { + else val defaultPath = new File(new File(System.getProperty("prog.home", "")), path.getPath) if defaultPath.exists() then Some(defaultPath) else None - } def readAsString(f: File): String = readAsString(f.toURI.toURL) diff --git a/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/AsyncHandler.scala b/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/AsyncHandler.scala index 7da2cc5a6a..5df6a3525b 100644 --- a/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/AsyncHandler.scala +++ b/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/AsyncHandler.scala @@ -4,7 +4,7 @@ import java.io.Flushable import java.util import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.{Executors, ThreadFactory, TimeUnit} -import java.util.{logging as jl} +import java.util.logging as jl /** * Logging using a background thread diff --git a/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/LogRotationHandler.scala b/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/LogRotationHandler.scala index b35193e37d..27750050c2 100644 --- a/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/LogRotationHandler.scala +++ b/airframe-core/.jvm/src/main/scala-3/wvlet/airframe/log/LogRotationHandler.scala @@ -16,7 +16,7 @@ package wvlet.airframe.log import java.io.{File, Flushable} import java.nio.charset.StandardCharsets import java.util.logging.ErrorManager -import java.util.{logging as jl} +import java.util.logging as jl import ch.qos.logback.core.ContextBase import ch.qos.logback.core.encoder.EncoderBase import ch.qos.logback.core.rolling.{ diff --git a/airframe-core/src/main/scala-3/wvlet/airframe/log/Handler.scala b/airframe-core/src/main/scala-3/wvlet/airframe/log/Handler.scala index d50b288365..021f761c96 100644 --- a/airframe-core/src/main/scala-3/wvlet/airframe/log/Handler.scala +++ b/airframe-core/src/main/scala-3/wvlet/airframe/log/Handler.scala @@ -1,7 +1,7 @@ package wvlet.airframe.log import java.io.{PrintStream, PrintWriter} -import java.util.{logging as jl} +import java.util.logging as jl /** * Output log to stderr diff --git a/airframe-core/src/main/scala-3/wvlet/airframe/log/LogFormat.scala b/airframe-core/src/main/scala-3/wvlet/airframe/log/LogFormat.scala index e3bbce6a16..acf99009f2 100644 --- a/airframe-core/src/main/scala-3/wvlet/airframe/log/LogFormat.scala +++ b/airframe-core/src/main/scala-3/wvlet/airframe/log/LogFormat.scala @@ -18,7 +18,7 @@ import wvlet.airframe.log.AnsiColorPalette import java.io.{PrintWriter, StringWriter} import java.util.logging.Formatter import java.util.regex.Pattern -import java.util.{logging as jl} +import java.util.logging as jl import wvlet.airframe.log.LogLevel.{DEBUG, ERROR, INFO, TRACE, WARN} /** diff --git a/airframe-core/src/main/scala-3/wvlet/airframe/log/LogRecord.scala b/airframe-core/src/main/scala-3/wvlet/airframe/log/LogRecord.scala index c48c1601ad..acf6866a23 100644 --- a/airframe-core/src/main/scala-3/wvlet/airframe/log/LogRecord.scala +++ b/airframe-core/src/main/scala-3/wvlet/airframe/log/LogRecord.scala @@ -13,7 +13,7 @@ */ package wvlet.airframe.log -import java.util.{logging as jl} +import java.util.logging as jl object LogRecord: def apply(record: jl.LogRecord): LogRecord = diff --git a/airframe-http/.jvm/src/main/scala/wvlet/airframe/http/Router.scala b/airframe-http/.jvm/src/main/scala/wvlet/airframe/http/Router.scala index 67874a538f..e1ac4e3da6 100644 --- a/airframe-http/.jvm/src/main/scala/wvlet/airframe/http/Router.scala +++ b/airframe-http/.jvm/src/main/scala/wvlet/airframe/http/Router.scala @@ -220,8 +220,7 @@ object Router extends router.RouterObjectBase with LogSupport { private[http] def isFuture(s: Surface): Boolean = { s match { - case h: HigherKindedTypeSurface - if h.typeArgs.size == 1 && h.name == "F" => // Only support 'F' for tagless-final pattern + case h: HigherKindedTypeSurface if h.typeArgs.size == 1 && h.name == "F" => // Only support 'F' for tagless-final pattern true case s: Surface if s.rawType == classOf[scala.concurrent.Future[_]] || s.rawType.getName == "com.twitter.util.Future" => @@ -233,8 +232,7 @@ object Router extends router.RouterObjectBase with LogSupport { private[http] def unwrapFuture(s: Surface): Surface = { s match { - case h: HigherKindedTypeSurface - if h.typeArgs.size == 1 && h.name == "F" => // Only support 'F' for tagless-final pattern + case h: HigherKindedTypeSurface if h.typeArgs.size == 1 && h.name == "F" => // Only support 'F' for tagless-final pattern h.typeArgs.head case s: Surface if s.rawType == classOf[scala.concurrent.Future[_]] || s.rawType.getName == "com.twitter.util.Future" => diff --git a/airframe-rx-html/src/main/scala/wvlet/airframe/rx/html/HtmlAttrs.scala b/airframe-rx-html/src/main/scala/wvlet/airframe/rx/html/HtmlAttrs.scala index 12f137c342..77bbddfab1 100644 --- a/airframe-rx-html/src/main/scala/wvlet/airframe/rx/html/HtmlAttrs.scala +++ b/airframe-rx-html/src/main/scala/wvlet/airframe/rx/html/HtmlAttrs.scala @@ -77,9 +77,7 @@ trait GlobalAttrs { * Specifies the text direction for the content in an element. The valid values are: * * - `ltr` Default. Left-to-right text direction - * * - `rtl` Right-to-left text direction - * * - `auto` Let the browser figure out the text direction, based on the content, (only recommended if the text * direction is unknown) */ @@ -759,7 +757,6 @@ trait InputAttrs extends GlobalAttrs { * * - post: Corresponds to the HTTP POST method ; form data are included in the body of the form and sent to the * server. - * * - get: Corresponds to the HTTP GET method; form data are appended to the action attribute URI with a '?' as a * separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and * contains only ASCII characters. diff --git a/airframe-surface/src/main/scala-3/wvlet/airframe/surface/CompileTimeSurfaceFactory.scala b/airframe-surface/src/main/scala-3/wvlet/airframe/surface/CompileTimeSurfaceFactory.scala index 73200ad56f..d20ee6e810 100644 --- a/airframe-surface/src/main/scala-3/wvlet/airframe/surface/CompileTimeSurfaceFactory.scala +++ b/airframe-surface/src/main/scala-3/wvlet/airframe/surface/CompileTimeSurfaceFactory.scala @@ -380,8 +380,7 @@ private[surface] class CompileTimeSurfaceFactory[Q <: Quotes](using quotes: Q): private def isPathDependentType(t: TypeRepr): Boolean = !t.typeSymbol.flags.is(Flags.JavaStatic) && (t match case t: TypeBounds => true - case _ => false - ) + case _ => false) private def genericTypeFactory: Factory = { case t if t =:= TypeRepr.of[Any] => diff --git a/airframe-surface/src/main/scala/wvlet/airframe/surface/tag/package.scala b/airframe-surface/src/main/scala/wvlet/airframe/surface/tag/package.scala index a2a2ad9579..a1ac6aa360 100644 --- a/airframe-surface/src/main/scala/wvlet/airframe/surface/tag/package.scala +++ b/airframe-surface/src/main/scala/wvlet/airframe/surface/tag/package.scala @@ -19,7 +19,7 @@ import scala.language.implicitConversions /** * This code is from com.softwaremill.tagging * - * Tag instances with arbitrary types. The tags are usually empty `trait`s. Tags have no runtime overhead and are only + * Tag instances with arbitrary types. The tags are usually empty `trait` s. Tags have no runtime overhead and are only * used at compile-time for additional type safety. * * For example: diff --git a/airspec/build.sbt b/airspec/build.sbt index 5342627eec..7fb1d8f1d2 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/project/plugin.sbt b/airspec/project/plugin.sbt index 75d20b2ff8..ed6087e958 100755 --- a/airspec/project/plugin.sbt +++ b/airspec/project/plugin.sbt @@ -10,7 +10,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1") addDependencyTreePlugin // For Scala.js -val SCALAJS_VERSION = sys.env.getOrElse("SCALAJS_VERSION", "1.18.1") +val SCALAJS_VERSION = sys.env.getOrElse("SCALAJS_VERSION", "1.18.1") addSbtPlugin("org.scala-js" % "sbt-scalajs" % SCALAJS_VERSION) addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.21.1") libraryDependencies ++= ( diff --git a/build.sbt b/build.sbt index 606380119f..ec793414c8 100644 --- a/build.sbt +++ b/build.sbt @@ -974,7 +974,7 @@ lazy val fluentd = "org.komamitsu" % "fluency-fluentd" % FLUENCY_VERSION, "org.komamitsu" % "fluency-treasuredata" % FLUENCY_VERSION // td-client-java -> json-simple happened to include junit 4.10 [CVE-2020-15250] - exclude ("junit", "junit"), + exclude ("junit", "junit"), // Necessary for td-client-java, which is used in fluency-treasuredata "com.fasterxml.jackson.datatype" % "jackson-datatype-json-org" % "2.18.2" % Provided, "com.fasterxml.jackson.datatype" % "jackson-datatype-jdk8" % "2.18.2" % Provided, diff --git a/project/plugin.sbt b/project/plugin.sbt index a63162e019..cb6b6f7806 100755 --- a/project/plugin.sbt +++ b/project/plugin.sbt @@ -20,7 +20,7 @@ addSbtPlugin("org.wvlet.airframe" % "sbt-airframe" % SBT_AIRFRAME_VERSION) addDependencyTreePlugin // For Scala.js -val SCALAJS_VERSION = sys.env.getOrElse("SCALAJS_VERSION", "1.18.1") +val SCALAJS_VERSION = sys.env.getOrElse("SCALAJS_VERSION", "1.18.1") addSbtPlugin("org.scala-js" % "sbt-scalajs" % SCALAJS_VERSION) addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.21.1") libraryDependencies ++= ( diff --git a/sbt-airframe/src/sbt-test/sbt-airframe/js-client/project/plugins.sbt b/sbt-airframe/src/sbt-test/sbt-airframe/js-client/project/plugins.sbt index 7783b653ed..99bfcc8254 100644 --- a/sbt-airframe/src/sbt-test/sbt-airframe/js-client/project/plugins.sbt +++ b/sbt-airframe/src/sbt-test/sbt-airframe/js-client/project/plugins.sbt @@ -8,4 +8,4 @@ sys.props.get("plugin.version") match { // For Scala.js addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") val SCALAJS_VERSION = sys.env.getOrElse("SCALAJS_VERSION", "1.18.1") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % SCALAJS_VERSION) +addSbtPlugin("org.scala-js" % "sbt-scalajs" % SCALAJS_VERSION)