Skip to content

Commit 31e6183

Browse files
committed
scalafix: leverage scalafixEnable & scalafixAll
1 parent a7a85c3 commit 31e6183

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

README.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ 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) if you are using an old version of sbt (<1.3) or in case the commands below do not work.
5353

5454
```scala
5555
// project/plugins.sbt
@@ -62,14 +62,13 @@ The `Collection213Upgrade` rewrite upgrades to the 2.13 collections without the
6262

6363
```scala
6464
// build.sbt
65-
ThisBuild / scalafixDependencies += "org.scala-lang.modules" %% "scala-collection-migrations" % "<version>"
66-
addCompilerPlugin(scalafixSemanticdb)
67-
scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on")
65+
scalacOptions += "-P:semanticdb:synthetics:on"
6866
```
6967

7068
```bash
7169
// sbt shell
72-
> ;test:scalafix Collection213Upgrade ;scalafix Collection213Upgrade
70+
> scalafixEnable
71+
> scalafixAll dependency:[email protected]:scala-collection-migrations:<version>
7372
```
7473

7574
### Collection213CrossCompat
@@ -80,23 +79,15 @@ To cross-build for 2.12 and 2.11, the rewrite rule introduces a dependency on th
8079

8180
```scala
8281
// build.sbt
83-
ThisBuild / scalafixDependencies += "org.scala-lang.modules" %% "scala-collection-migrations" % "<version>"
8482
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "<version>"
85-
addCompilerPlugin(scalafixSemanticdb)
86-
scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on")
83+
scalacOptions += "-P:semanticdb:synthetics:on"
8784
```
8885

8986

9087
```bash
9188
// 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}
89+
> scalafixEnable
90+
> scalafixAll dependency:[email protected]:scala-collection-migrations:<version>
10091
```
10192

10293
### Contributing

0 commit comments

Comments
 (0)