scalafix icon indicating copy to clipboard operation
scalafix copied to clipboard

scalafix CLI should include scala-library on the classpath by default

Open mackenziestarr opened this issue 2 years ago • 0 comments

In order to test out the ExplicitResultTypes semantic rule with scalafix CLI like the example in the docs, one currently has to include scala-library in the --classpath argument.

$ scalafix --scala-version 2.13.10 --verbose --rules ExplicitResultTypes --classpath=/tmp/scala-library-2.13.10.jar --semanticdb-targetroots . --stdout
info: Processing (0/1) /tmp/scalafix-sandbox/Main.scala
package com.example
object Main {
  def myComplexMethod: Map[Int,String] = 1.to(10).map(i => i -> i.toString).toMap
}

I think it'd be a smoother developer experience to include scala-library (and possibly other org.scala-lang.* libraries) on the classpath by default so that small examples with semantic rules work when people are using scalafix CLI as a means to try out the tooling for the first time.

originally surfaced in https://github.com/scalameta/scalameta/issues/2979

mackenziestarr avatar Dec 07 '22 18:12 mackenziestarr