-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.scalafmt.conf
More file actions
130 lines (113 loc) · 3.25 KB
/
.scalafmt.conf
File metadata and controls
130 lines (113 loc) · 3.25 KB
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
# Scalafmt configuration for spark-pipeline-framework
#
# RESPONSIBILITY: Code formatting
# - Whitespace, indentation, line breaks
# - Import ordering and grouping
# - Brace placement, alignment
#
# DEFERS TO:
# - Scalastyle: Naming conventions, complexity metrics
# - Scalafix: Semantic issues (unused code - we only format, not analyze)
#
# SYNC WITH scalastyle-config.xml:
# - maxColumn = 120 (scalastyle: maxLineLength=120)
# - indent.main = 2 (scalastyle: tabSize=2)
#
# Run: sbt scalafmtAll (format) or sbt scalafmtCheckAll (check)
version = "3.7.17"
# Scala dialect - support both 2.12 and 2.13
runner.dialect = scala213source3
# Line length - MUST MATCH scalastyle FileLineLengthChecker maxLineLength=120
maxColumn = 120
# Indentation - MUST MATCH scalastyle tabSize=2
indent.main = 2
indent.callSite = 2
indent.defnSite = 2
indent.ctorSite = 2
indent.caseSite = 2
indent.extendSite = 2
indent.withSiteRelativeToExtends = 2
# Alignment settings
align.preset = more
align.openParenCallSite = false
align.openParenDefnSite = false
align.arrowEnumeratorGenerator = true
align.tokens."+" = [
{ code = "=>", owner = "Case" }
{ code = "<-", owner = "Enumerator.Generator" }
{ code = "%", owner = "Term.ApplyInfix" }
{ code = "%%", owner = "Term.ApplyInfix" }
]
# Newlines
newlines.source = keep
newlines.topLevelStatementBlankLines = [
{ blanks { before = 1 } }
]
newlines.beforeCurlyLambdaParams = multilineWithCaseOnly
newlines.afterCurlyLambdaParams = squash
newlines.implicitParamListModifierPrefer = before
newlines.avoidForSimpleOverflow = [tooLong, punct, slc]
# Rewrite rules
rewrite.rules = [
AvoidInfix
RedundantBraces
RedundantParens
SortModifiers
PreferCurlyFors
]
rewrite.redundantBraces.stringInterpolation = true
rewrite.redundantBraces.generalExpressions = false
rewrite.sortModifiers.order = [
"override", "private", "protected", "final", "sealed", "abstract", "implicit", "lazy"
]
# Imports
rewrite.imports.sort = scalastyle
rewrite.imports.groups = [
["com\\.example\\..*"]
["org\\.apache\\.spark\\..*"]
[".*"]
["scala\\..*"]
["java\\..*", "javax\\..*"]
]
# Spaces - matches scalastyle SpacesAfterPlusChecker, SpacesBeforePlusChecker
spaces.inImportCurlyBraces = false
spaces.inParentheses = false
spaces.afterKeywordBeforeParen = true
spaces.inByNameTypes = true
spaces.beforeContextBoundColon = Never
# Docstrings
docstrings.style = Asterisk
docstrings.blankFirstLine = yes
docstrings.wrap = no
docstrings.oneline = fold
# Trailing commas - Scala 2.12+ compatible
trailingCommas = preserve
# Vertical multiline - for method definitions and calls
verticalMultiline.atDefnSite = true
verticalMultiline.arityThreshold = 4
verticalMultiline.newlineAfterOpenParen = true
# Dangline parentheses
danglingParentheses.preset = true
danglingParentheses.callSite = true
danglingParentheses.defnSite = true
# Option fit - for chained method calls
optIn.configStyleArguments = true
# Comment wrapping - disabled to preserve manual formatting
comments.wrap = standalone
comments.wrapStandaloneSlcAsSlc = true
# Project settings
project.git = true
project.excludeFilters = [
".metals"
"target"
".sbt"
]
# File override for sbt files
fileOverride {
"glob:**/*.sbt" {
runner.dialect = sbt1
}
"glob:**/project/*.scala" {
runner.dialect = scala212
}
}