From 9dbf7aaa02e7e99fcf7f7927879270d7fe1e17b1 Mon Sep 17 00:00:00 2001 From: Brice Jaglin Date: Fri, 4 Oct 2024 12:15:14 +0200 Subject: [PATCH] explain when and how to run CLI with a given Scala version --- docs/users/installation.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/users/installation.md b/docs/users/installation.md index 7b1392ece..eccb5523c 100644 --- a/docs/users/installation.md +++ b/docs/users/installation.md @@ -411,13 +411,28 @@ git diff // should produce a diff First, install the [Coursier](https://get-coursier.io/docs/cli-installation) command-line interface. -Next, install a `scalafix` binary with Coursier +Then, download the Scalafix runner built with the latest version of Scala +(@SCALA3NEXT@) ```sh cs install scalafix ./scalafix --version # Should say @VERSION@ ``` +> If you plan to use advanced semantic rules like `ExplicitResultTypes`, you +> must use the version of Scalafix built with a Scala version matching your +> target source files. +> +> If your target file are not built with the latest minor version of Scala, +> use one of the following commands to create a custom runner for the most +> appropriate version +> +> ```sh +> cs bootstrap ch.epfl.scala:scalafix-cli_@SCALA212@:@VERSION@ --main scalafix.cli.Cli -o scalafix_2.12 +> cs bootstrap ch.epfl.scala:scalafix-cli_@SCALA213@:@VERSION@ --main scalafix.cli.Cli -o scalafix_2.13 +> cs bootstrap ch.epfl.scala:scalafix-cli_@SCALA3LTS@:@VERSION@ --main scalafix.cli.Cli -o scalafix_3-lts +> ``` + ### Help ```scala mdoc:--help