Skip to content

fix with scalafix rules does not respect excluding sourcesΒ #3905

@Gedochao

Description

@Gedochao

Version(s)
1.9.1

Describe the bug
The fix sub-command scalafix rules is ignoring whatever is passed with --exclude///> using exclude.
Fails complaining about SemanticDB files tied to excluded sources.
Everything works fine if only built-in rules are ran.

To Reproduce

//1.scala
//> using options -Wunused:all
//> using dependency org.scalameta::munit::1.1.0
//2.scala
//> using dep com.lihaoyi::utest::0.8.5
object Messages {
  val hello = "hello"
  def function() = {
    val whatever = "whatever"
    hello
  }
}
//project.scala
//> exclude 2.scala
//scalafix.conf
rules  = [
  DisableSyntax
]
scala-cli fix . --power
# Running built-in rules...
# Writing project.scala
# Built-in rules completed.
# Running scalafix rules...
# [hint] ./project.scala:3:22
# [hint] "munit is outdated, update to 1.2.0"
# [hint]      munit 1.1.0 -> org.scalameta::munit::1.2.0
# [hint] //> using dependency org.scalameta::munit::1.1.0
# [hint]                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
# error: SemanticDB not found: 2.scala

Expected behaviour
Excluded sources should not influence behaviour of fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    --excludeIssues tied with the excluding inputs.bugSomething isn't workingexperimentalTickets tied to experimental features.scalafixIssues tied with scalafix integrationsubcommand:fixissues tied to the `fix` sub-command.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions