-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.scalafmt.conf
138 lines (121 loc) · 3.36 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version = "3.6.1"
style = default
runner.dialect = "scala212"
project.excludeFilters = [
".idea/.*"
"target/.*"
"project/target/.*"
"dist/.*"
".git/.*"
]
maxColumn = 100
indent {
main = 2
significant = 2
callSite = 2
defnSite = 4
ctrlSite = 4
caseSite = 5
extendSite = 4
withSiteRelativeToExtends = 0
commaSiteRelativeToExtends = 8
}
indentOperator.topLevelOnly = false
align {
preset = most
tokens = [
{code = "=>", owner = Case}
{code = "%", owner = "Term.ApplyInfix"}
{code = "%%", owner = "Term.ApplyInfix"}
{code = ":=", owner = Infix}
{code = "<-", owner = "Enumerator.Generator"}
{code = "->", owner = "Term.ApplyInfix"}
":"
"="
]
arrowEnumeratorGenerator = false
closeParenSite = false
openParenCallSite = false
openParenDefnSite = false
openParenTupleSite = true
multiline = true
}
newlines {
topLevelStatementBlankLines = [
{ blanks { before = 0, after = 0, beforeEndMarker = 0, beforeAll = 0, afterAll = 1}, regex = "Import"} //Insert break after imports
{ blanks { before = 1, after = 1, beforeEndMarker = 0, beforeAll = -1, afterAll = -1}, regex = "Defn\\.Def"} //Insert break before def but avoid when it's first or last statement
{ blanks { before = 1, after = 1, beforeEndMarker = 0, beforeAll = 0, afterAll = 0}, regex = "Defn\\.Object"} // Insert break after object definition
{ blanks { before = 1, after = 1, beforeEndMarker = 0, beforeAll = 0, afterAll = 0}, regex = "Defn\\.Class"} // Insert break after class definition
{ blanks { before = 0, after = 0, beforeEndMarker = 0, beforeAll = -1, afterAll = -1}, regex = "Defn\\.Val"} // Remove any break if it's for example first val in class
]
beforeMultiline = fold
alwaysBeforeElseAfterCurlyIf = false
beforeCurlyLambdaParams = multilineWithCaseOnly
afterCurlyLambdaParams = squash
implicitParamListModifierPrefer = after
avoidForSimpleOverflow = [tooLong, slc]
avoidInResultType = true
afterInfix = many
selectChains = unfold
sometimesBeforeColonInMethodReturnType = false
forceBeforeMultilineAssign = any
}
danglingParentheses {
defnSite = true
callSite = true
tupleSite = true
}
rewrite {
rules = [RedundantBraces, RedundantParens, SortModifiers, PreferCurlyFors, Imports]
redundantBraces {
stringInterpolation = true
generalExpressions = true
ifElseExpressions = true
methodBodies = true
includeUnitMethods = true
parensForOneLineApply = true
maxLines = 20
}
sortModifiers.order = [
"implicit", "lazy", "final", "sealed",
"override", "private", "protected", "abstract"
]
imports.expand = false
imports.sort = scalastyle
trailingCommas.style = multiple
}
verticalMultiline.newlineAfterOpenParen = true
docstrings {
style = Asterisk
removeEmpty = false
oneline = fold
}
spaces {
beforeContextBoundColon = Always
afterKeywordBeforeParen = false
inByNameTypes = true
afterSymbolicDefs = false
}
literals {
long = "Upper"
float = "Upper"
double = "Upper"
hexPrefix = "Lower"
hexDigits = "Upper"
scientific = "Lower"
}
binPack {
literalsExclude = [
"Term.Name"
]
literalArgumentLists = true
parentConstructors = Never
}
includeNoParensInSelectChains = true
optIn {
breakChainOnFirstMethodDot = false
breaksInsideChains = false
encloseClassicChains = false
}
importSelectors = "noBinPack"
assumeStandardLibraryStripMargin = false