-
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.
Merge pull request #411 from bjaglin/store-analysis
avoid full (re)compilation after cold scalafix invocations
- Loading branch information
Showing
4 changed files
with
57 additions
and
39 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
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 |
---|---|---|
@@ -1,22 +1,45 @@ | ||
# we have 2 fatal warnings preventing compilation | ||
# when the build does not contain any flag relaxed on scalafix invocation | ||
# check that regular compilation benefits froma prior direct scalafix invocation ... | ||
-> scalafix --check RemoveUnused | ||
-> checkLastCompilationCached | ||
> compile | ||
> checkLastCompilationCached | ||
|
||
# ... and indirect scalafix invocation | ||
> clean | ||
> test:scalafix --check RemoveUnused | ||
-> checkLastCompilationCached | ||
> compile | ||
> checkLastCompilationCached | ||
|
||
# we now have 2 fatal warnings preventing compilation | ||
> set scalacOptions ++= Seq("-Xfatal-warnings") | ||
-> compile | ||
|
||
# ensure that a semantic rule can be ran despite warnings, to fix one of the warning | ||
> scalafixAll RemoveUnused | ||
> scalafix RemoveUnused | ||
|
||
# but that the zinc analysis file has not been persisted, otherwise the run with relax scalacOptions would | ||
# cause the next compile to be full (non-incremental) no matter if there was a previous successful compilation | ||
-> checkZincAnalysisPresent | ||
# confirm that the rule was applied and that triggered compilation is cached once the updated file recompiled | ||
> scalafix --check RemoveUnused | ||
-> checkLastCompilationCached | ||
> scalafix --check RemoveUnused | ||
> checkLastCompilationCached | ||
|
||
# and that -Xfatal-warnings remains honored for regular compilation | ||
-> compile | ||
|
||
# confirm that compilation succeeds after fixing the last warning | ||
# confirm that regular compilation succeeds after fixing the last warning | ||
> scalafix ProcedureSyntax | ||
> compile | ||
> checkZincAnalysisPresent | ||
|
||
# check that there is no recompilation when running a semantic rule after a successful compilation | ||
-> checkLastCompilationCached | ||
> scalafixAll RemoveUnused | ||
# check that regular compilation is cached as usual | ||
> compile | ||
> checkLastCompilationCached | ||
|
||
# check that there is no recompilation when running a semantic rule after a regular compilation ... | ||
> scalafix RemoveUnused | ||
> checkLastCompilationCached | ||
|
||
# nor when compiling after running a semantic rule | ||
> compile | ||
> checkLastCompilationCached |