-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.scalafmt.conf
45 lines (39 loc) · 1.46 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
// 2.5.0
version = 2.6.4
preset = defaultWithAlign
docstrings.style = Asterisk
maxColumn = 120
rewrite.rules = [RedundantParens, SortImports]
unindentTopLevelOperators = true
// This is only for projects using Scala 2.12.2+. Projects using Scala 2.11
// should set this to "preserve".
trailingCommas = multiple
// Unicode arrows can cause operator precedence issues. They are deprecated in
// Scala 2.13 and will not be present in Scala 3.
rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}
// Warning: file overrides do not seem to work when using scalafmt from IntelliJ.
// If you want to format SBT files so that these settings are applied, you
// should use the appropriate sbt plugin. You can install it globally by adding
// the following line to `$HOME/.sbt/1.0/plugins/plugins.sbt`:
//
// (note that 2.4.0 is just the plugin version)
// addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
//
// You will then be able to use the `scalafmtSbt` task to format the sbt files.
// Check all the available sbt tasks here:
// https://scalameta.org/scalafmt/docs/installation.html#task-keys
fileOverride {
"glob:**/*.sbt" {
// When set to true, weird extra indentation appears when assigning sbt
// settings.
unindentTopLevelOperators = false
// SBT 1+ uses Scala 2.12, so trailing commas are supported. Ensure they
// are added to the build files regardless of the Scala version used for
// the application code.
trailingCommas = multiple
}
}