Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix & simplify instructions to run autofix for a one-time migration #26

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions 3.0.x/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,37 @@
# Autofix for ScalaTest 3.0.x
This scalafix application will rewrite your ScalaTest code to eliminate most of the deprecation warnings
This scalafix rule will rewrite your ScalaTest code to eliminate most of the deprecation warnings
introduced in ScalaTest 3.0.8. The deprecations were primarily renames of packages containing integrations with
third-party libraries, such as JUnit, TestNG, Java mocking frameworks, Selenium, and ScalaCheck. The purpose
of these renames in 3.0.8 is to prepare the way for modularization of these third-party integrations in
ScalaTest 3.1.0. This will allow the third-party integrations to be versioned independently with ScalaTest.

To use this plugin, please follows these steps (for Maven, use the <a href="https://github.com/evis/scalafix-maven-plugin">scalafix-maven-plugin</a>):
To use this plugin with sbt, please follow these steps ([Maven](https://github.com/evis/scalafix-maven-plugin)
and [Mill](https://github.com/joan38/mill-scalafix) plugins are also available):

- Add `sbt-scalafix` to your `project/plugins.sbt`:
- Add `sbt-scalafix` to your `project/plugins.sbt` (a [newer version](https://github.com/scalacenter/sbt-scalafix/releases) might be required for the latest Scala releases):

```
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.11")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.18-1")
```

- Add the following settings to your `build.sbt`:

```
scalafixDependencies in ThisBuild += "org.scalatest" %% "autofix" % "3.0.8-0"

addCompilerPlugin(scalafixSemanticdb) // enable SemanticDB
```

- Or, if your project doesn't use a `build.sbt`, you'll need to make the above changes to `project/your-build-file.sbt`.

- If you have `-Xfatal-warnings` set, comment it out for the scalafix process, because otherwise
the deprecation warnings will stop your build before autofix is given a chance to fix them.

```
// scalacOptions += "-Xfatal-warnings"
```

- In the sbt prompt, issue the following command to have autofix applied to your test source files:
- Enable scalafix for the current sbt session:

```
sbt> test:scalafix RenameDeprecatedPackage
sbt> scalafixEnable
```

- In case you want to apply autofix to your main source files, you'll issue the following command:
- In the sbt prompt, issue the following command to have autofix applied to your main & test source files:

```
sbt> scalafix RenameDeprecatedPackage
```
sbt> scalafixAll dependency:RenameDeprecatedPackage@org.scalatest:autofix:3.0.8-0
```

- Check the changes made with `git diff`.

Expand All @@ -51,4 +42,3 @@ scalacOptions += "-Xfatal-warnings"
```



33 changes: 11 additions & 22 deletions 3.1.x/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,37 @@
# Autofix for ScalaTest 3.1.x
This scalafix application will rewrite your ScalaTest code to eliminate most of the deprecation warnings
This scalafix rule will rewrite your ScalaTest code to eliminate most of the deprecation warnings
introduced in ScalaTest 3.1.0. The deprecations were primarily renames of object, classes, and traits to
pave the way for the internal modularization of ScalaTest in 3.2.0. The internal modularization of ScalaTest
will allow projects to depend on a chosen subset of ScalaTest in their build to more easily keep test code
consistent across the project.

To use this plugin with sbt, please follows these steps (for Maven, use the <a href="https://github.com/evis/scalafix-maven-plugin">scalafix-maven-plugin</a>):
To use this plugin with sbt, please follow these steps ([Maven](https://github.com/evis/scalafix-maven-plugin)
and [Mill](https://github.com/joan38/mill-scalafix) plugins are also available):

- Add `sbt-scalafix` to your `project/plugins.sbt`:
- Add `sbt-scalafix` to your `project/plugins.sbt` (a [newer version](https://github.com/scalacenter/sbt-scalafix/releases) might be required for the latest Scala releases):

```
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.11")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.18-1")
```

- Add the following settings to your `build.sbt`:

```
scalafixDependencies in ThisBuild += "org.scalatest" %% "autofix" % "3.1.0.0"

addCompilerPlugin(scalafixSemanticdb) // enable SemanticDB
```

- Or, if your project doesn't use a `build.sbt`, you'll need to make the above changes to `project/your-build-file.sbt`.

- If you have `-Xfatal-warnings` set, comment it out for the scalafix process, because otherwise
the deprecation warnings will stop your build before autofix is given a chance to fix them.

```
// scalacOptions += "-Xfatal-warnings"
```

- In the sbt prompt, issue the following command to have autofix applied to your test source files:
- Enable scalafix for the current sbt session:

```
sbt> test:scalafix RewriteDeprecatedNames
sbt> scalafixEnable
```

- In case you want to apply autofix to your main source files, you'll issue the following command:
- In the sbt prompt, issue the following command to have autofix applied to your main & test source files:

```
sbt> scalafix RewriteDeprecatedNames
```
sbt> scalafixAll dependency:RewriteDeprecatedNames@org.scalatest:autofix:3.1.0.0
```

- Check the changes made with `git diff`.

Expand All @@ -50,5 +41,3 @@ sbt> scalafix RewriteDeprecatedNames
scalacOptions += "-Xfatal-warnings"
```