This implements a very basic version of a check flag. If any dependencies that should move to the workspace are found, they are printed to stderr and the command exits with a FAILURE ExitCode.
If any dependencies are found in a workspace member, but that have an existing workspace dependency that can be directly used (that is if the workspace Cargo.toml doesn't need to be modified) nothing is printed, but the command still exits with FAILURE.
Ideally the check flag would work like cargo fmt --check where a diff is shown, but that would require extensive refactoring.
Not sure if you'll be okay with ^ limitations. If not I may be able to find some time in the future to try making proper diffs possible, not sure.
Also, I've added ExitCode as the return from auto_inherit in lib.rs. That's more of a command specific thing, but I thought it would be good to differentiate between "failed to run the command" and "the command ran successfully, but indicated failure". I can make it something else if you find using std::process::ExitCode for that too gross.
This implements a very basic version of a check flag. If any dependencies that should move to the workspace are found, they are printed to stderr and the command exits with a FAILURE
ExitCode
.If any dependencies are found in a workspace member, but that have an existing workspace dependency that can be directly used (that is if the workspace Cargo.toml doesn't need to be modified) nothing is printed, but the command still exits with FAILURE.
Ideally the check flag would work like
cargo fmt --check
where a diff is shown, but that would require extensive refactoring.Not sure if you'll be okay with ^ limitations. If not I may be able to find some time in the future to try making proper diffs possible, not sure.
Also, I've added
ExitCode
as the return fromauto_inherit
in lib.rs. That's more of a command specific thing, but I thought it would be good to differentiate between "failed to run the command" and "the command ran successfully, but indicated failure". I can make it something else if you find usingstd::process::ExitCode
for that too gross.resolves #2