enso/.scalafmt.conf
2019-11-26 14:02:50 +01:00

82 lines
2.2 KiB
Plaintext

// Scala Formatting Configuration
// All Scala files should be reformatted through this formatter before being
// committed to the repositories.
version = "2.1.1"
// Wrapping and Alignment
align = most
align.openParenCallSite = false
align.openParenDefnSite = false
align.tokens = [
{code = "=>", owner = "Case"}
{code = "%", owner = "Term.ApplyInfix"}
{code = "%%", owner = "Term.ApplyInfix"}
{code = "%%%", owner = "Term.ApplyInfix"}
{code = "="}
{code = "<-"}
{code = "->"}
{code = "||"}
{code = "+:="}
{code = "?="}
{code = "extends"}
{code = "//"}
{code = "{"}
{code = "}"}
{code = ":", owner = "Defn.Def"}
{code = ":", owner = "Decl.Def"}
]
maxColumn = 80
verticalAlignMultilineOperators = true
// Comments and Documentation
docstrings = "scaladoc"
// Indentation
assumeStandardLibraryStripMargin = true
continuationIndent.callSite = 2
continuationIndent.defnSite = 2
// Newlines
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`"
]
// Rewrite Rules
rewrite.rules = [
PreferCurlyFors,
RedundantParens,
SortModifiers,
SortImports,
]
rewrite.sortModifiers.order = [
"implicit", "final", "sealed", "abstract",
"override", "private", "protected", "lazy"
]
// Multiline Configuration
verticalMultiline.atDefnSite = false
verticalMultiline.arityThreshold = 6
// Please remember that `//format: off` and `//format: on` directives should be
// used sparingly, if at all.