Skip to content

Commit 1198757

Browse files
committed
scalafix: leverage scalafixEnable & scalafixAll
1 parent a6d5f2f commit 1198757

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

README.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,20 @@ And, it includes support for some non-collections classes such as the `@nowarn`
4949

5050
## Migration rules
5151

52-
The migration rules use scalafix. Please see the [official installation instructions](https://scalacenter.github.io/scalafix/docs/users/installation.html) and, in particular, check that your full Scala version is supported (ex 2.12.16).
52+
The migration rules use scalafix. Please see the [official installation instructions](https://scalacenter.github.io/scalafix/docs/users/installation.html) in case the commands below do not work.
5353

5454
```scala
5555
// project/plugins.sbt
56-
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34")
56+
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1")
5757
```
5858

5959
### Collection213Upgrade
6060

6161
The `Collection213Upgrade` rewrite upgrades to the 2.13 collections without the ability to compile the code-base with 2.12 or 2.11. This rewrite is suitable for applications that don't need to cross-compile against multiple Scala versions.
6262

63-
```scala
64-
// build.sbt
65-
ThisBuild / scalafixDependencies += "org.scala-lang.modules" %% "scala-collection-migrations" % "<version>"
66-
addCompilerPlugin(scalafixSemanticdb)
67-
scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on")
68-
```
69-
7063
```bash
7164
// sbt shell
72-
> ;test:scalafix Collection213Upgrade ;scalafix Collection213Upgrade
65+
> ;scalafixEnable ;scalafixAll dependency:Collection213Upgrade@org.scala-lang.modules:scala-collection-migrations:<version>
7366
```
7467

7568
### Collection213CrossCompat
@@ -80,23 +73,13 @@ To cross-build for 2.12 and 2.11, the rewrite rule introduces a dependency on th
8073

8174
```scala
8275
// build.sbt
83-
ThisBuild / scalafixDependencies += "org.scala-lang.modules" %% "scala-collection-migrations" % "<version>"
8476
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "<version>"
85-
addCompilerPlugin(scalafixSemanticdb)
86-
scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on")
8777
```
8878

8979

9080
```bash
9181
// sbt shell
92-
> ;test:scalafix Collection213CrossCompat ;scalafix Collection213CrossCompat
93-
```
94-
95-
### Build.scala
96-
97-
```scala
98-
// If you are using project/Build.scala add the following imports:
99-
import scalafix.sbt.ScalafixPlugin.autoImport.{scalafixDependencies, scalafixSemanticdb}
82+
> ;scalafixEnable ;scalafixAll dependency:[email protected]:scala-collection-migrations:<version>
10083
```
10184

10285
### Contributing

0 commit comments

Comments
 (0)