save-cli icon indicating copy to clipboard operation
save-cli copied to clipboard

Improved logic of directory mode in warn plugin

Open petertrr opened this issue 3 years ago • 1 comments

As we discussed:

  1. [warn] plugin -> is simply processing separate files
  2. [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

petertrr avatar Jun 24 '22 14:06 petertrr

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 :)

petertrr avatar Jun 24 '22 14:06 petertrr