-
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.
scalafixEnable: relax -Xfatal-warnings for scalafix invocations
scalafixEnable should maximize the chances of getting semanticdb-scalac to run so that semantic rules can run. When enabled in the build, -Xfatal-warnings can be a major obstacle for example when: 1. scalafixEnable forced a newer (patch) Scala version that the one in the build, with improved warning reporting; 2. the user already has a build with fatal deprecation warnings and wants to apply a rewrite rule to fix them.
- Loading branch information
1 parent
e311d0b
commit c72992e
Showing
4 changed files
with
52 additions
and
8 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
4 changes: 4 additions & 0 deletions
4
.../sbt-scalafix/scalafixEnable/scala212/src/main/scala/UnusedImportAndProcedureSyntax.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,4 @@ | ||
object UnusedImportAndProcedureSyntax { | ||
import java.util.Calendar | ||
def main {} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
-> check | ||
> scalafixEnable | ||
> check | ||
|
||
# we have 2 fatal warnings preventing compilation | ||
-> scala212/compile | ||
|
||
# ensure that a semantic rule can be ran despite warnings, to fix one of the warning | ||
> scala212/scalafix RemoveUnused | ||
|
||
# but that -Xfatal-warnings remains honored for regular compilation | ||
-> scala212/compile | ||
|
||
# confirm that compilation succeeds after fixing the last warning | ||
> scala212/scalafix ProcedureSyntax | ||
> scala212/compile |