-
Notifications
You must be signed in to change notification settings - Fork 24
/
.scalafmt.conf
56 lines (48 loc) · 1.64 KB
/
.scalafmt.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
version = "3.7.17"
maxColumn = 130
runner.debug = true
runner.dialect = scala213Source3
rewrite.scala3.convertToNewSyntax = true
align.preset = most
align.multiline = true
align.tokens."+" = [
{code = ":", owner = ".*"},
]
align.arrowEnumeratorGenerator = true
align.allowOverflow = true
docstrings.style = keep
#docstrings.wrapMaxColumn = 100
#docstrings.blankFirstLine = yes
lineEndings = preserve
includeCurlyBraceInSelectChains = false
danglingParentheses.preset = true
optIn.annotationNewlines = true
binPack.parentConstructors = Always
indentOperator.exemptScope = all
indentOperator.excludeRegex = "^.*$"
assumeStandardLibraryStripMargin = true
// try to have condensed lambda, but when multiline is needed,
// keep param with the open '{' :
// foo.map { x =>
// ....
newlines.alwaysBeforeMultilineDef = false
newlines.beforeCurlyLambdaParams = multilineWithCaseOnly
newlines.afterCurlyLambdaParams = squash
rewrite.rules = [RedundantBraces, SortModifiers, PreferCurlyFors, Imports]
rewrite.redundantBraces.defnBodies = none // keep around def body
rewrite.redundantBraces.generalExpressions = false // keep {} around while/etc
rewrite.redundantBraces.stringInterpolation = false // keep {} in string interpol
// use () in place of {} for lambda when possible
rewrite.redundantBraces.parensForOneLineApply = true
// remove {} is there is only one line in the block
rewrite.redundantBraces.maxBreaks = 2
rewrite.insertBraces.minLines = 2
rewrite.insertBraces.allBlocks = true
// one import per line appart when renaming imported element
rewrite.imports.expand = true
rewrite.imports.sort = scalastyle
rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}