aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStewart Stewart <stewinsalot@gmail.com>2016-10-10 17:34:50 -0400
committerStewart Stewart <stewinsalot@gmail.com>2016-10-10 17:34:50 -0400
commit186758c074655c6593323fc4e8de786d16b8568f (patch)
treedc82d87516a9ef15610e79be1304704afce735ea
parent20684d242b098aca03068df4857f6e1929397f73 (diff)
downloadsbt-settings-186758c074655c6593323fc4e8de786d16b8568f.tar.gz
sbt-settings-186758c074655c6593323fc4e8de786d16b8568f.tar.bz2
sbt-settings-186758c074655c6593323fc4e8de786d16b8568f.zip
update scalafmt
-rw-r--r--build.sbt2
-rw-r--r--src/main/scala/com.drivergrp.sbt/SbtSettings.scala35
2 files changed, 20 insertions, 17 deletions
diff --git a/build.sbt b/build.sbt
index 52e6fa9..a414cb1 100644
--- a/build.sbt
+++ b/build.sbt
@@ -8,7 +8,7 @@ scalaVersion := "2.10.6"
publishMavenStyle := true
// Code style plugins
-addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.2.10")
+addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.4.5")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "1.0.1")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
diff --git a/src/main/scala/com.drivergrp.sbt/SbtSettings.scala b/src/main/scala/com.drivergrp.sbt/SbtSettings.scala
index 746fb68..967fd7a 100644
--- a/src/main/scala/com.drivergrp.sbt/SbtSettings.scala
+++ b/src/main/scala/com.drivergrp.sbt/SbtSettings.scala
@@ -36,32 +36,35 @@ object SbtSettings extends AutoPlugin {
"""# scalafmt sbt plugin config
|# refer to https://olafurpg.github.io/scalafmt/#Configuration for properties
|
- |--style defaultWithAlign # For pretty alignment.
- |--maxColumn 120 # For my wide 30" display.
+ |style = defaultWithAlign # For pretty alignment.
+ |maxColumn = 120 # For my wide 30" display.
|
- |--reformatDocstrings true
+ |reformatDocstrings = true
|--scalaDocs
|
- |--continuationIndentCallSite 4
- |--continuationIndentDefnSite 4
+ |continuationIndent.callSite = 4
+ |continuationIndent.defnSite = 4
|
- |--rewriteTokens ⇒;=>,←;<-
- |--danglingParentheses false
- |--spaceAfterTripleEquals true
- |--alignByArrowEnumeratorGenerator true
- |--binPackParentConstructors true
- |--allowNewlineBeforeColonInMassiveReturnTypes true
- |--spacesInImportCurlyBraces false
+ |rewriteTokens: {
+ | "⇒" = "=>"
+ | "←" = "<-"
+ |}
+ |danglingParentheses = false
+ |spaces.afterTripleEquals = true
+ |alignByArrowEnumeratorGenerator = true
+ |binPack.parentConstructors = true
+ |newlines.sometimesBeforeColonInMethodReturnType = true
+ |spaces.inImportCurlyBraces = false
|
- |# --alignByOpenParenCallSite <value>
- |# --alignByOpenParenDefnSite <value>
+ |# align.openParenCallSite = <value>
+ |# align.openParenDefnSite = <value>
|
""".stripMargin
- val formatFile = file(".scalafmt")
+ val formatFile = file(".scalafmt.conf")
IO.write(formatFile, contents)
Seq(formatFile)
}.taskValue,
- scalafmtConfig in ThisBuild := Some(file(".scalafmt")),
+ scalafmtConfig in ThisBuild := Some(file(".scalafmt.conf")),
testExecution in (Test, test) <<=
(testExecution in (Test, test)) dependsOn (scalafmtTest in Compile, scalafmtTest in Test))