mirror of https://github.com/sbt/sbt.git
In the code formatting use case, the formatting task may modify the source files in place. If the formatting task uses the nio inputFileStamps, then it would fill the in-memory cache of source paths to file stamps. This would cause compile to see the pre-formatted stamps. To fix this, we can invalidate the file cache entries for the outputs of a task. This will cause the side-effect of some extra io because the hashes may be computed three times: once for the format inputs, once for the format outputs and once for the compile inputs. I think most users would understand that adding auto-formatting would potentially slowdown compilation. To really prove this out, I implemented a poor man's scalafmt plugin in a scripted test. It is fully incremental. Even in the case when some files cannot be formatted it will update all of the files that can be formatted and not re-format them until they change. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||