Remove tmp directories, created by plugins after their execution
It seems, that we remove tmp directories only before plugin execution by clean() method.
It's a good point, because if SAVE crashed on something during the previous execution, we anyway will remove old trash.
However, we hold all temp files after SAVE's work, it's seems to be not a good style, and probably we should remove
tmp files before and after execution
Under this task it also should be refactored cleanupTempDir it's abstract method in Plugin, which have the same logic in
Warn and Fix, instead of name of directories. This name could be a property of corresponding plugins, and logic could be moved in to common logic
We also should reconsider the way temporary directories are named. Now we usually use Plugin's ::class.simpleName, but this causes two parallel executions to clash. Now we are facing it only as flaking tests (e.g. I just saw on CI java.io.FileNotFoundException: /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/FixPlugin/fix_and_warn/smoke/src/main/kotlin/org/cqfn/save/chapter1/Bug1Test.kt (No such file or directory), while native test is executed correctly. I believe this is caused by clash of directory names, because similar issues have been fixed, when we started using random directory names for our tests.
We should probably create a root tmp dir (like "$FileSystem.SYSTEM_TEMPORARY_DIRECTORY/save-tool") and delete it only after execution. And we can encapsulate all this logic in some sort of common tmp directory provider, which can also track a list of created directories.
See also https://github.com/diktat-static-analysis/save/pull/310#discussion_r749432400