scalafix
scalafix copied to clipboard
Refactoring and linting tool for Scala
Advanced semantic rules such as `ExplicitResultTypes` or [`ExplicitNonNullaryApply`](https://github.com/scala/scala-rewrites/blob/v0.1.1/rewrites/src/main/scala/fix/scala213/ExplicitNonNullaryApply.scala) using the presentation compiler via `ScalafixGlobal` require the build `scalaVersion` to match `scalafixScalaBinaryVersion`, and potentially the full Scala release used by Scalafix....
`-Wconf:` options were added in Scala 2.13.2. `warning-verbose` includes category and location in logging output, which is apparently being parsed to find the unused imports.
https://github.com/scalacenter/scalafix/blob/d55b09bc18fe97686bd995fa44186e9ea18e9772/scalafix-tests/input/src/main/scala/test/ReplaceSymbol.scala#L1-L29 demonstrates usage of simple symbol replacements via `--rules=replace:from/to` and via the `patches.replaceSymbols` configuration key, backed by https://github.com/scalacenter/scalafix/blob/6811967f6e6059a59d8b04e7f2b76eb3c3ddcfbc/scalafix-core/src/main/scala/scalafix/patch/Patch.scala#L125-L143 As of 0.10.4, this is not documented publicly in tutorials (but [does...
Currently in the documentation it shows that that you should install scalafix in the following way: ```scala addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.13") ``` However, `0.9.13` is the current version of...
When adding or maintaining integration tests via `scalafix-testkit`, it can be useful to dump the "actual" result of running the rules to the "expected" files, in the `output` directory. This...
``` [error] failed to generate semanticdb for .../XXX.scala: [error] java.lang.ArrayIndexOutOfBoundsException: -1 [error] at scala.meta.internal.semanticdb.scalac.DiagnosticOps$XtensionCompilationUnitDiagnostics$$anonfun$reportedDiagnostics$1.apply(DiagnosticOps.scala:21) [error] at scala.meta.internal.semanticdb.scalac.DiagnosticOps$XtensionCompilationUnitDiagnostics$$anonfun$reportedDiagnostics$1.apply(DiagnosticOps.scala:11) [error] at scala.collection.immutable.List.map(List.scala:288) [error] at scala.meta.internal.semanticdb.scalac.DiagnosticOps$XtensionCompilationUnitDiagnostics.reportedDiagnostics(DiagnosticOps.scala:11) [error] at scala.meta.internal.semanticdb.scalac.TextDocumentOps$XtensionCompilationUnitDocument.toTextDocument(TextDocumentOps.scala:721) [error] at scala.meta.internal.semanticdb.scalac.SemanticdbPipeline$SemanticdbTyperComponent$ComputeSemanticdbPhase.saveSemanticdbForCompilationUnit(SemanticdbPipeline.scala:60) [error]...
Scala 2.13.2 / 2.12.11 / 2.11.12 SemanticDB 4.3.13 Scalafix 0.9.16 It looks like `scalac` is running dead code elimination early-on, so `-Wunused` / `-Ywarn-unused` does not raise warnings for *some*...
Reopening https://github.com/scalacenter/scalafix/issues/684. (/cc @dsilvasc) Is there a good reason for prohibiting `lazy val`s in abstract classes/traits? As per https://docs.scala-lang.org/tutorials/FAQ/initialization-order.html is seems to be fine.
## TL;DR Hit `scalafix.internal.v1.FileException` while testing a snapshot release (`0.3.0+9-86c91c86-SNAPSHOT`) of the [`OrganizeImports` rule](https://github.com/liancheng/scalafix-organize-imports/tree/86c91c8634ace360d417b7172288203375df8abf) against Metals master. ## How to reproduce 1. Checkout scalameta/metals@7b88c09 2. Apply the following diff: ```diff...
In scalafmt, the `onTestFailure: String` setting can be customized to print out a message on `--test` failure. See http://scalameta.org/scalafmt/#Other It would be nice if scalafix did the same, so that...