Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 100 additions & 48 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,52 +1,104 @@
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
version = 3.7.4

runner.dialect = scala213

fileOverride {
"glob:**/scala-3*/**" {
runner.dialect = scala3
}
}

# Only format files tracked by git
project.git = true

# f/k/a style =
preset = defaultWithAlign

# f/k/a JavaDoc
docstrings {
style = Asterisk
oneline = fold
}

indentOperator {
preset = akka

# f/f/k/a unindentTopLevelOperators = true
# f/k/a topLevelOnly=false
exemptScope = all
}

maxColumn = 120
lineEndings = preserve

rewrite {
rules = [
AvoidInfix,
RedundantParens,
Imports
]

neverInfix.excludeFilters = [
and
min
max
until
to
by
eq
ne
"should.*"
"contain.*"
"must.*"
in
ignore
be
taggedAs
thrownBy
synchronized
have
when
size
only
noneOf
oneElementOf
noElementsOf
atLeastOneElementOf
atMostOneElementOf
allElementsOf
inOrderElementsOf
theSameElementsAs
theSameElementsInOrderAs
]

imports {
sort = original
}
}

spaces.inImportCurlyBraces = true
rewrite.neverInfix.excludeFilters = [
and
min
max
until
to
by
eq
ne
"should.*"
"contain.*"
"must.*"
in
ignore
be
taggedAs
thrownBy
synchronized
have
when
size
only
noneOf
oneElementOf
noElementsOf
atLeastOneElementOf
atMostOneElementOf
allElementsOf
inOrderElementsOf
theSameElementsAs
theSameElementsInOrderAs
]

align {
tokens = [
{ code = "=>", owner = "Case" }
]
openParenCallSite = false
openParenDefnSite = false
}

optIn {
breakChainOnFirstMethodDot = false
encloseClassicChains = true
configStyleArguments = false
}

danglingParentheses {
defnSite = false
callSite = false
ctrlSite = false
tupleSite = false
}

rewriteTokens = {
"⇒": "=>"
"→": "->"
Expand Down
3 changes: 3 additions & 0 deletions akka-actor/src/main/scala/akka/actor/dungeon/Dispatch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ final case class SerializationCheckFailedException private[dungeon] (msg: Object
@InternalApi
private[akka] trait Dispatch { this: ActorCell =>

// scalafmt breaks this by moving the _ to its own line which doesn't compile
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interaction of breaking long lines in scalafmt with the semicolon inference in at least Scala 3.3.1

// format: off
@nowarn @volatile private var _mailboxDoNotCallMeDirectly
: Mailbox = _ //This must be volatile since it isn't protected by the mailbox status
// format: on

@nowarn private def _preventPrivateUnusedErasure = {
_mailboxDoNotCallMeDirectly
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ libraryDependencies += Defaults.sbtPluginExtra(

addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.8.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("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
Expand Down