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:
- frontend for Cargo
- a program invoked like
cargo diet
supporting a few flags
- a program invoked like
- 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
- glue between the
- 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.