2019-06-12 13:48:42 +03:00
|
|
|
// Scala Formatting Configuration
|
2019-06-11 19:07:54 +03:00
|
|
|
|
|
|
|
// All Scala files should be reformatted through this formatter before being
|
|
|
|
// committed to the repositories.
|
|
|
|
|
2019-11-07 15:10:21 +03:00
|
|
|
version = "2.1.1"
|
2019-06-11 19:07:54 +03:00
|
|
|
|
|
|
|
// Wrapping and Alignment
|
2019-06-09 04:55:17 +03:00
|
|
|
align = most
|
2019-06-11 19:07:54 +03:00
|
|
|
align.openParenCallSite = false
|
|
|
|
align.openParenDefnSite = false
|
2019-06-09 04:55:17 +03:00
|
|
|
align.tokens = [
|
|
|
|
{code = "=>", owner = "Case"}
|
|
|
|
{code = "%", owner = "Term.ApplyInfix"}
|
|
|
|
{code = "%%", owner = "Term.ApplyInfix"}
|
2019-11-26 16:02:50 +03:00
|
|
|
{code = "%%%", owner = "Term.ApplyInfix"}
|
2019-06-09 04:55:17 +03:00
|
|
|
{code = "="}
|
|
|
|
{code = "<-"}
|
2019-09-12 17:47:25 +03:00
|
|
|
{code = "->"}
|
|
|
|
{code = "||"}
|
|
|
|
{code = "+:="}
|
|
|
|
{code = "?="}
|
2019-06-09 04:55:17 +03:00
|
|
|
{code = "extends"}
|
2019-09-12 17:47:25 +03:00
|
|
|
{code = "//"}
|
|
|
|
{code = "{"}
|
|
|
|
{code = "}"}
|
2019-06-09 04:55:17 +03:00
|
|
|
{code = ":", owner = "Defn.Def"}
|
2019-09-12 17:47:25 +03:00
|
|
|
{code = ":", owner = "Decl.Def"}
|
2019-06-09 04:55:17 +03:00
|
|
|
]
|
2019-06-11 19:07:54 +03:00
|
|
|
maxColumn = 80
|
|
|
|
verticalAlignMultilineOperators = true
|
|
|
|
|
|
|
|
// Comments and Documentation
|
|
|
|
docstrings = "scaladoc"
|
|
|
|
|
|
|
|
// Indentation
|
|
|
|
assumeStandardLibraryStripMargin = true
|
|
|
|
continuationIndent.callSite = 2
|
|
|
|
continuationIndent.defnSite = 2
|
|
|
|
|
|
|
|
// Newlines
|
2019-09-12 17:47:25 +03:00
|
|
|
newlines.neverInResultType = false
|
|
|
|
newlines.neverBeforeJsNative = false
|
|
|
|
newlines.sometimesBeforeColonInMethodReturnType = true
|
|
|
|
newlines.penalizeSingleSelectMultiArgList = true
|
|
|
|
newlines.alwaysBeforeCurlyBraceLambdaParams = false
|
|
|
|
newlines.alwaysBeforeTopLevelStatements = false
|
|
|
|
newlines.afterCurlyLambda = never
|
|
|
|
newlines.afterImplicitKWInVerticalMultiline = false
|
|
|
|
newlines.beforeImplicitKWInVerticalMultiline = false
|
|
|
|
newlines.alwaysBeforeElseAfterCurlyIf = false
|
|
|
|
newlines.avoidAfterYield = true
|
|
|
|
verticalMultilineAtDefinitionSite = false
|
|
|
|
verticalMultilineAtDefinitionSiteArityThreshold = 100
|
|
|
|
verticalMultiline.atDefnSite = false
|
|
|
|
verticalMultiline.arityThreshold = 100
|
|
|
|
verticalMultiline.newlineBeforeImplicitKW = false
|
|
|
|
verticalMultiline.newlineAfterImplicitKW = false
|
|
|
|
verticalMultiline.newlineAfterOpenParen = false
|
|
|
|
verticalMultiline.excludeDanglingParens = [
|
|
|
|
"`class`"
|
|
|
|
"`trait`"
|
|
|
|
]
|
2019-06-11 19:07:54 +03:00
|
|
|
|
|
|
|
// Rewrite Rules
|
2019-06-09 04:55:17 +03:00
|
|
|
rewrite.rules = [
|
2019-06-11 19:07:54 +03:00
|
|
|
PreferCurlyFors,
|
|
|
|
RedundantParens,
|
|
|
|
SortModifiers,
|
2019-11-18 14:18:16 +03:00
|
|
|
SortImports,
|
2019-06-11 19:07:54 +03:00
|
|
|
]
|
|
|
|
rewrite.sortModifiers.order = [
|
|
|
|
"implicit", "final", "sealed", "abstract",
|
|
|
|
"override", "private", "protected", "lazy"
|
|
|
|
]
|
|
|
|
|
|
|
|
// Multiline Configuration
|
2019-09-12 17:47:25 +03:00
|
|
|
verticalMultiline.atDefnSite = false
|
|
|
|
verticalMultiline.arityThreshold = 6
|
|
|
|
|
2019-06-11 19:07:54 +03:00
|
|
|
// Please remember that `//format: off` and `//format: on` directives should be
|
2019-06-12 13:48:42 +03:00
|
|
|
// used sparingly, if at all.
|