diff --git a/README.md b/README.md index 408ebba..21e59f0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Installing ``` // project/plugins.sbt -addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.7.0") +addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.7.1") ``` Configuration (build.sbt) @@ -36,11 +36,6 @@ Automatically format on `compile` or `test:compile` SbtScalariform.scalariformSettings ++ Seq(preferences) ``` -Format on demand (run `scalariformFormat` or `test:scalariformFormat` to format files) -``` -SbtScalariform.formatOnDemandSettings ++ Seq(preferences) -``` - If you want to additionally enable Scalariform for your integration tests, use `scalariformSettingsWithIt` or `defaultScalariformSettingsWithIt` instead of the above. Other useful configuration options are provided by common sbt setting keys: diff --git a/build.sbt b/build.sbt index 4a62ae9..13de94e 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ val sbtScalariform = Project(projectName, file(".")) organization := "org.scalariform" name := projectName sonatypeProfileName := organization.value -version in ThisBuild := "1.7.1-SNAPSHOT" +version in ThisBuild := "1.7.1" scalaVersion := "2.10.6" licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))) diff --git a/project/plugins.sbt b/project/plugins.sbt index 9433f9d..7c31cae 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0") +addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.7.0") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") diff --git a/src/main/scala/com/typesafe/sbt/SbtScalariform.scala b/src/main/scala/com/typesafe/sbt/SbtScalariform.scala index 2e83a2e..6a06588 100644 --- a/src/main/scala/com/typesafe/sbt/SbtScalariform.scala +++ b/src/main/scala/com/typesafe/sbt/SbtScalariform.scala @@ -17,7 +17,7 @@ package com.typesafe.sbt import sbt._ -import sbt.{ IntegrationTest => It } +import sbt.{IntegrationTest => It} import sbt.Keys._ import scala.collection.immutable.Seq import scalariform.formatter.preferences.IFormattingPreferences @@ -62,14 +62,14 @@ object SbtScalariform extends AutoPlugin { ).toList def defaultScalariformSettings: Seq[Setting[_]] = - formatOnDemandSettings ++ inConfig(Compile)(configScalariformSettings) ++ inConfig(Test)(configScalariformSettings) + baseScalariformSettings ++ inConfig(Compile)(configScalariformSettings) ++ inConfig(Test)(configScalariformSettings) def defaultScalariformSettingsWithIt: Seq[Setting[_]] = defaultScalariformSettings ++ inConfig(It)(configScalariformSettings) def configScalariformSettings: Seq[Setting[_]] = List( - (sourceDirectories in Global in scalariformFormat) := unmanagedSourceDirectories.value, + (sourceDirectories in scalariformFormat) := unmanagedSourceDirectories.value, scalariformFormat := Scalariform( scalariformPreferences.value, (sourceDirectories in scalariformFormat).value.toList, @@ -82,9 +82,12 @@ object SbtScalariform extends AutoPlugin { ) ) - def formatOnDemandSettings: Seq[Setting[_]] = + def baseScalariformSettings: Seq[Setting[_]] = List( scalariformPreferences in Global := defaultPreferences, includeFilter in Global in scalariformFormat := "*.scala" ) + + @deprecated("To disable autoformatting see: https://github.com/sbt/sbt-scalariform/blob/master/README.md", "1.7.1") + def formatOnDemandSettings: Seq[Setting[_]] = baseScalariformSettings }