Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 2.13 KB

CONTRIBUTING.md

File metadata and controls

27 lines (22 loc) · 2.13 KB

Thank you for considering to contribute! All contributions are welcome, may it be in the form of issues and PRs.

To get you started on adjusting code, it's important to know that this program is split into three parts:

  1. frontend for Cargo
    • a program invoked like cargo diet supporting a few flags
  2. A library
    • glue between the criner-waste-report crate and the command-line arguments
    • editing of Cargo.toml files
    • pretty-printing of changes and savings
  3. The criner-waste-report crate
    • The actual logic to determine which include and/or excludes to provide

For 1) and 2) the best way to validate changes in code is to run make continuous-journey-tests, which are defined in this shell script. cargo diet is tested on the highest possible level, only validating functionality in the way it is actually seen by the user. The tests are by no means complete, but cover common combinations of flags and prevent regressions or unanticipated changes in the most common scenarios.

For 3), it's best to clone criner and cd criner-waste-report. From there unit tests are run with cargo test. The respective binary fixtures can be generated conveniently using the dev-support feature cargo build --features dev-support, which allows it to be called on any sample crate such as in /path/to/cargo-diet/target/debug/cargo-diet diet -n --save-package-for-unit-test /path/to/criner/criner-waste-report/mycrate-v1.rmp. Now a new assertion similar to this one can be added, allowing to state a new expectation and fast iterations on the code without risking to break anything in unexpected ways.

If there are questions or the need for suggestions, we are happy to help in the respective issues or PRs.