nitrocli icon indicating copy to clipboard operation
nitrocli copied to clipboard

Migrate to clap 3.0.0

Open robinkrahl opened this issue 3 years ago • 2 comments

Finally, the first release candidate for clap 3.0.0 is available. structopt will not be updated for clap 3.0.0 (https://github.com/TeXitoi/structopt/issues/516), so it will not receive any new features, and we were having some issues (at least #114) that should be fixed in clap 3.0.0. Therefore I think we should consider migrating to clap 3.0.0. I suggest the following migration steps:

  1. add snapshot tests for the --help output of all subcommands and for the --version output
  2. prepare a patch that migrates from structopt to clap 3.0.0-rc.1
  3. compare compile time and binary sizes and decide whether we want to go forward with the migration

Thoughts?

(Looking at the benchmarks, we should expect a small binary size increase, but at least improvements are planned.)

robinkrahl avatar Dec 09 '21 22:12 robinkrahl

Thanks for bringing up this topic. Indeed, just saw the release today. Can you please clarify what you are referring to by snapshot tests? I assume some golden-output comparison of sorts? Other than that question what you propose sounds like a good plan to me.

d-e-s-o avatar Dec 10 '21 02:12 d-e-s-o

Can you please clarify what you are referring to by snapshot tests?

Basically comparing the output to some expected value read from a text file. insta is a useful framework for such tests. Of course this is not meant to be prescriptive, but as a means to assess the changes and to detect unintended behavior.

robinkrahl avatar Dec 10 '21 09:12 robinkrahl