forked from vitorsvieira/scala-iso
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.scalafmt.conf
120 lines (99 loc) · 2.42 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
version = "3.7.3"
# Indentation
continuationIndent {
callSite = 2
defnSite = 2
ctorSite = 2
extendSite = 1
withSiteRelativeToExtends = 2
}
# Alignment
maxColumn = 100
assumeStandardLibraryStripMargin = true
align {
preset = some
openParenCallSite = false
openParenDefnSite = false
stripMargin = true
}
# Newlines
newlines {
source = keep
topLevelStatements = [before, after]
topLevelStatementsMinBreaks = 1
alwaysBeforeMultilineDef = true
alwaysBeforeElseAfterCurlyIf = false
alwaysBeforeCurlyBraceLambdaParams = true //after 2.7.1 change to "beforeCurlyLambdaParams = multilineWithCaseOnly"
afterCurlyLambda = squash //after 2.7.0 change to "afterCurlyLambdaurlyLambdaParams = squash"
implicitParamListModifierPrefer = before
sometimesBeforeColonInMethodReturnType = false // If true, scalafmt may choose to put a newline before colon : at defs.
}
optIn.configStyleArguments = true
runner.optimizer {
forceConfigStyleOnOffset = 150
forceConfigStyleMinArgCount = 2
}
danglingParentheses {
defnSite = true
callSite = true
ctrlSite = false
exclude = [class, trait]
}
# Rewrite Rules
rewrite.rules = [
AvoidInfix,
RedundantBraces,
RedundantParens,
SortImports, // The imports are sorted by the groups: symbols, lower-case, upper-case.
SortModifiers // Modifiers are sorted based on the given order.
]
rewrite.redundantBraces {
generalExpressions = false //after 2.7.0 change to true
//after 2.7.0 add "ifElseExpressions = false"
methodBodies = true
includeUnitMethods = false
stringInterpolation = true
parensForOneLineApply = true
maxLines = 100
}
trailingCommas = never // Makes sure there are no trailing commas
# Comment Processing
comments {
wrap = no
wrapStandaloneSlcAsSlc = false
}
docstrings {
style = SpaceAsterisk
oneline = unfold
wrap = no
blankFirstLine = yes
}
# Spaces
spaces {
beforeContextBoundColon = Always
inImportCurlyBraces = false
inParentheses = false
neverAroundInfixTypes = []
afterKeywordBeforeParen = true
inByNameTypes = true
afterSymbolicDefs = false
}
# Literals
literals {
long = Upper
float = Lower
double = Lower
hexPrefix = Lower
hexDigits = Lower
scientific = Lower
}
# XML
# Binpacking
binPack {
literalArgumentLists = true
parentConstructors = OnelineIfPrimaryOneline
}
# Classic select chains
includeCurlyBraceInSelectChains = true
includeNoParensInSelectChains = false
optIn.breakChainOnFirstMethodDot = true