Skip to content

Commit

Permalink
Merge pull request #97 from alejandrohdezma/breaking/it
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrohdezma authored Apr 15, 2020
2 parents af73d68 + e3289cd commit b3cd223
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 77 deletions.
6 changes: 0 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ ThisBuild / scalafixConfigLocation := url {
ThisBuild / scalafmtConfigLocation := url {
"https://github.com/alejandrohdezma/sbt-fix-defaults/releases/download/v0.0.6/default.scalafmt.conf"
}

Global / onChangedBuildSource := ReloadOnSourceChanges

addCommandAlias("ci-test", "fix --check; docs/mdoc")
Expand All @@ -31,8 +30,3 @@ lazy val `sbt-fix` = project
.enablePlugins(SbtPlugin)
.settings(addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.12"))
.settings(addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.2"))

lazy val `sbt-fix-it` = project
.dependsOn(`sbt-fix`)
.enablePlugins(SbtPlugin)
.settings(description := "Enables scalafix/scalafmt settings in it configuration")
18 changes: 0 additions & 18 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,6 @@ fix --check

Which can be used in CI to check formatting easily.

## Integration tests

If you normally use the configuration for integration tests that SBT provides you can use `sbt-fix-it` (instead of `sbt-fix`). Add the following line to your `plugins.sbt` file:

```sbt
addSbtPlugin("com.alejandrohdezma" %% "sbt-fix-it" % "@VERSION@")
```

This plugin contains all the extras and settings of the `sbt-fix` as well as automatically activating the `IntegrationTest` configuration and its default settings (as described in the [SBT documentation](https://www.scala-sbt.org/1.x/docs/Testing.html#Integration+Tests)) and adds the [scalafix](https://scalacenter.github.io/scalafix/docs/users/installation.html#integration-tests) and [scalafmt](https://scalameta.org/scalafmt/docs/installation.html#enable-integrationtest) settings for this configuration.

```diff
lazy val `my-project` = project
- .configs(IntegrationTest)
- .settings(inConfig(IntegrationTest)(Defaults.testSettings))
- .settings(inConfig(IntegrationTest)(scalafixConfigSettings(IntegrationTest)))
- .settings(inConfig(IntegrationTest)(org.scalafmt.sbt.ScalafmtPlugin.scalafmtConfigSettings))
```

[github-action]: https://github.com/alejandrohdezma/sbt-fix/actions
[github-action-badge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Falejandrohdezma%2Fsbt-fix%2Fbadge%3Fref%3Dmaster&style=flat

Expand Down
2 changes: 1 addition & 1 deletion project/dependencies.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// For using the plugins in their own build
// For using the plugin in its own build
unmanagedSourceDirectories in Compile +=
baseDirectory.in(ThisBuild).value.getParentFile / "sbt-fix" / "src" / "main" / "scala"

This file was deleted.

0 comments on commit b3cd223

Please # to comment.