-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip validation if there are no sources to fix.
Previously, the semanticdb-scalac and scalacOptions validation ran for empty root projects with no sources, failing the build when running scalafix from the root project. Since there are no sources to fix we should not run any validation.
- Loading branch information
Showing
6 changed files
with
65 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
inThisBuild( | ||
List( | ||
scalaVersion := "2.12.6", | ||
) | ||
) | ||
|
||
lazy val root = project | ||
.in(file(".")) | ||
.aggregate(lib) | ||
|
||
lazy val lib = project | ||
.in(file("lib")) | ||
.settings( | ||
addCompilerPlugin(scalafixSemanticdb), | ||
scalacOptions ++= List( | ||
"-Ywarn-unused", | ||
"-Yrangepos" | ||
) | ||
) | ||
|
6 changes: 6 additions & 0 deletions
6
src/sbt-test/sbt-scalafix/root-validation/lib/src/main/scala/lib/App.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package lib | ||
|
||
import scala.concurrent.Future | ||
import scala.util.Success | ||
|
||
object App { println(Success(1)) } |
3 changes: 3 additions & 0 deletions
3
src/sbt-test/sbt-scalafix/root-validation/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
resolvers += Resolver.sonatypeRepo("releases") | ||
libraryDependencies += "com.googlecode.java-diff-utils" % "diffutils" % "1.3.0" | ||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % sys.props("plugin.version")) |
1 change: 1 addition & 0 deletions
1
src/sbt-test/sbt-scalafix/root-validation/project/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M6") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-> root/scalafix --check RemoveUnused | ||
> root/scalafix RemoveUnused | ||
> root/scalafix --check RemoveUnused |