Skip to content

Commit 9c282a5

Browse files
authored
Merge pull request #2098 from bjaglin/cli-old-versions
explain when and how to run CLI with a given Scala version
2 parents 1bf297d + 124c190 commit 9c282a5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/users/installation.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,27 @@ git diff // should produce a diff
411411
First, install the [Coursier](https://get-coursier.io/docs/cli-installation)
412412
command-line interface.
413413

414-
Next, install a `scalafix` binary with Coursier
414+
Then, download the Scalafix runner built with the latest version of Scala
415+
(@SCALA3NEXT@)
415416

416417
```sh
417418
cs install scalafix
418419
./scalafix --version # Should say @VERSION@
419420
```
420421

422+
> If you plan to use advanced semantic rules like `ExplicitResultTypes`, you
423+
> must use the version of Scalafix built with a Scala version matching your
424+
> target source files.
425+
>
426+
> If your target files are not built with the latest minor version of Scala,
427+
> use one of the following commands to create a custom runner
428+
>
429+
> ```sh
430+
> cs bootstrap ch.epfl.scala:scalafix-cli_@SCALA212@:@VERSION@ --main scalafix.cli.Cli -o scalafix_2.12
431+
> cs bootstrap ch.epfl.scala:scalafix-cli_@SCALA213@:@VERSION@ --main scalafix.cli.Cli -o scalafix_2.13
432+
> cs bootstrap ch.epfl.scala:scalafix-cli_@SCALA3LTS@:@VERSION@ --main scalafix.cli.Cli -o scalafix_3-lts
433+
> ```
434+
421435
### Help
422436
423437
```scala mdoc:--help

0 commit comments

Comments
 (0)