diff --git a/.scalafmt.conf b/.scalafmt.conf index 5d45e749f6..efa297ee4a 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,21 +1,40 @@ -version = 2.1.0 - -style = defaultWithAlign - -docstrings = JavaDoc -indentOperator = spray -maxColumn = 120 -lineEndings = preserve -rewrite.rules = [RedundantParens, SortImports, AvoidInfix] -unindentTopLevelOperators = true -align.tokens = [{code = "=>", owner = "Case"}] -align.openParenDefnSite = false -align.openParenCallSite = false -optIn.breakChainOnFirstMethodDot = false -optIn.configStyleArguments = false -danglingParentheses = false -spaces.inImportCurlyBraces = true -rewrite.neverInfix.excludeFilters = [ +version = 3.6.1 +runner.dialect = scala213 +project.git = true +style = defaultWithAlign +docstrings.style = Asterisk +docstrings.wrap = false +indentOperator.preset = spray +maxColumn = 120 +lineEndings = preserve +rewrite.rules = [RedundantParens, SortImports, AvoidInfix] +indentOperator.exemptScope = all +align.preset = some +align.tokens."+" = [ + { + code = "~>" + owners = [ + { regex = "Term.ApplyInfix" } + ] + } +] +literals.hexDigits = upper +literals.hexPrefix = lower +binPack.unsafeCallSite = always +binPack.unsafeDefnSite = always +binPack.indentCallSiteSingleArg = false +binPack.indentCallSiteOnce = true +newlines.avoidForSimpleOverflow = [slc] +newlines.source = keep +newlines.beforeMultiline = keep +align.openParenDefnSite = false +align.openParenCallSite = false +align.allowOverflow = true +optIn.breakChainOnFirstMethodDot = false +optIn.configStyleArguments = false +danglingParentheses.preset = false +spaces.inImportCurlyBraces = true +rewrite.neverInfix.excludeFilters = [ and min max @@ -47,8 +66,12 @@ rewrite.neverInfix.excludeFilters = [ theSameElementsAs theSameElementsInOrderAs ] -rewriteTokens = { +rewriteTokens = { "⇒": "=>" "→": "->" "←": "<-" } +project.excludeFilters = [ + "scripts/authors.scala" +] +project.layout = StandardConvention diff --git a/project/plugins.sbt b/project/plugins.sbt index 61141db8e4..a70efe7e41 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,7 +5,7 @@ libraryDependencies += Defaults.sbtPluginExtra( addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0") addSbtPlugin("com.lightbend.sbt" % "sbt-bill-of-materials" % "1.0.2") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.33") // sbt-osgi 0.9.5 is available but breaks including jdk9-only classes // sbt-osgi 0.9.6 is available but breaks populating akka-protobuf-v3