Skip to content

Commit

Permalink
Merge pull request #62 from godenji/1.7.1
Browse files Browse the repository at this point in the history
1.7.1 release
  • Loading branch information
godenji authored Jul 24, 2017
2 parents 9cd2c6f + c40266c commit f6223b9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
11 changes: 7 additions & 4 deletions src/main/scala/com/typesafe/sbt/SbtScalariform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
}

0 comments on commit f6223b9

Please sign in to comment.