-
Notifications
You must be signed in to change notification settings - Fork 3
/
.scalafmt.conf
57 lines (49 loc) · 2.14 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
# Based on https://github.com/playframework/playframework/blob/main/.scalafmt.conf
# Version https://scalameta.org/scalafmt/docs/configuration.html#version
version = 3.7.1
# Dialect https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects
runner.dialect = scala213
# Top-level preset https://scalameta.org/scalafmt/docs/configuration.html#top-level-presets
preset = default
# Common https://scalameta.org/scalafmt/docs/configuration.html#most-popular
maxColumn = 120
assumeStandardLibraryStripMargin = true
# Alignment https://scalameta.org/scalafmt/docs/configuration.html#alignment
align {
preset = some
allowOverflow = true
}
# Newlines https://scalameta.org/scalafmt/docs/configuration.html#newlines
newlines {
alwaysBeforeElseAfterCurlyIf = true
alwaysBeforeMultilineDef = false
implicitParamListModifierPrefer = before
beforeCurlyLambdaParams = multilineWithCaseOnly
inInterpolation = "avoid"
}
# Spaces https://scalameta.org/scalafmt/docs/configuration.html#spaces
spaces {
inImportCurlyBraces = true # more idiomatic to include whitepsace in import x.{ yyy => zzz }
}
# Project https://scalameta.org/scalafmt/docs/configuration.html#project
# project {
# git = true
# excludePaths = ["glob:**/core/play/src/main/scala/play/core/hidden/ObjectMappings.scala"]
# }
# Rewrite Rules https://scalameta.org/scalafmt/docs/configuration.html#rewrite-rules
rewrite {
rules = [
AvoidInfix, # https://scalameta.org/scalafmt/docs/configuration.html#avoidinfix
RedundantParens, # https://scalameta.org/scalafmt/docs/configuration.html#redundantparens
SortModifiers, # https://scalameta.org/scalafmt/docs/configuration.html#sortmodifiers
PreferCurlyFors, # https://scalameta.org/scalafmt/docs/configuration.html#prefercurlyfors
Imports, # https://scalameta.org/scalafmt/docs/configuration.html#imports
]
sortModifiers.order = ["private", "protected", "final", "sealed", "abstract", "implicit", "override", "lazy"]
imports {
expand = true
sort = original
groups = [["java(x)?\\..*"], ["scala\\..*"], ["sbt\\..*"]]
}
trailingCommas.style = keep # https://scalameta.org/scalafmt/docs/configuration.html#trailing-commas
}