Skip to content

Commit 207f6e9

Browse files
committed
Scalariform settings in root build.sbt
1 parent 8cf5c7a commit 207f6e9

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

build.sbt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// update NEWS, update version in README.md, tag, then
33
// publishSigned.
44
// Release tags should follow: http://semver.org/
5+
import scalariform.formatter.preferences._
56

67
enablePlugins(GitVersioning)
78
git.baseVersion := "1.3.0"
@@ -22,7 +23,10 @@ val sonatype = new PublishToSonatype {
2223
}
2324

2425
lazy val commonSettings: Seq[Setting[_]] = Def.settings(
25-
unpublished
26+
unpublished,
27+
scalariformPreferences := scalariformPreferences.value
28+
.setPreference(IndentSpaces, 4)
29+
.setPreference(FirstArgumentOnNewline, Preserve)
2630
)
2731

2832
lazy val root = (project in file("."))
@@ -49,7 +53,10 @@ lazy val configLib = Project("config", file("config"))
4953
publish := sys.error("use publishSigned instead of plain publish"),
5054
publishLocal := sys.error("use publishLocalSigned instead of plain publishLocal"),
5155
packageOptions in (Compile, packageBin) +=
52-
Package.ManifestAttributes("Automatic-Module-Name" -> "typesafe.config" )
56+
Package.ManifestAttributes("Automatic-Module-Name" -> "typesafe.config" ),
57+
scalariformPreferences := scalariformPreferences.value
58+
.setPreference(IndentSpaces, 4)
59+
.setPreference(FirstArgumentOnNewline, Preserve)
5360
)
5461
.enablePlugins(SbtOsgi)
5562
.dependsOn(testLib % "test->test")

config/build.sbt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
import com.typesafe.sbt.SbtScalariform
2-
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
3-
import scalariform.formatter.preferences._
4-
5-
val formatPrefs = FormattingPreferences()
6-
.setPreference(IndentSpaces, 4)
7-
8-
ScalariformKeys.preferences in Compile := formatPrefs
9-
ScalariformKeys.preferences in Test := formatPrefs
10-
111
fork in test := true
122
fork in Test := true
133
fork in run := true

0 commit comments

Comments
 (0)