enso/.scalafmt.conf

81 lines
2.0 KiB
Plaintext
Raw Normal View History

// Scala Formatting Configuration
// All Scala files should be reformatted through this formatter before being
// committed to the repositories.
version = "2.7.4"
// Wrapping and Alignment
2019-06-09 04:55:17 +03:00
align = most
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 = "<-"}
{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
]
maxColumn = 80
verticalAlignMultilineOperators = true
// Comments and Documentation
docstrings = "spaceasterisk"
// 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.alwaysBeforeElseAfterCurlyIf = false
newlines.avoidAfterYield = true
verticalMultiline.atDefnSite = false
verticalMultiline.arityThreshold = 100
verticalMultiline.newlineBeforeImplicitKW = false
verticalMultiline.newlineAfterImplicitKW = false
verticalMultiline.newlineAfterOpenParen = false
verticalMultiline.excludeDanglingParens = [
"`class`"
"`trait`"
]
// Rewrite Rules
2019-06-09 04:55:17 +03:00
rewrite.rules = [
PreferCurlyFors,
RedundantParens,
SortModifiers,
2019-11-18 14:18:16 +03:00
SortImports,
]
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
// Please remember that `//format: off` and `//format: on` directives should be
// used sparingly, if at all.