Improved logic of directory mode in warn plugin
As we discussed:
- [warn] plugin -> is simply processing separate files
- [warn] plugin + DIRECTORY flag -> run ONLY on this directory. Plugin uses from one single file with all warnings (no inline warnings). It will make the logic less complex. In this mode (with directory flag) we will ignore other nested save.toml files and detect tests from the file with expected warnings.
We need to create a logic on save-cloud for it also...
Originally posted by @akuleshov7 in https://github.com/saveourtool/save-cli/issues/402#issuecomment-1165571071
Related bug in current implementation: #350
Another related comment from that thread: https://github.com/saveourtool/save-cli/issues/402#issuecomment-1164620902.
And one more suggestion - we discussed that we should extract test discovering logic into an interface with several implementations: match by suffix (default behavior of warn plugin), match a pair of files by suffix (fix plugin) and match all files in a directory (new logic). However, then we decided to remove discovering in directory mode and rely only on a file with a list of expected tests. Nevertheless, extracting logic is almost always a good idea :)