refactor(cargo-wdk): share project directory iteration - #722
refactor(cargo-wdk): share project directory iteration#722ITSMESB (ITSMERNB) wants to merge 1 commit into
Conversation
|
ITSMESB (@ITSMERNB) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors “emulated workspace” detection/iteration logic by introducing a shared iterator that yields immediate subdirectories containing a Cargo.toml, and then reuses it in both the build and clean actions.
Changes:
- Added a shared
CargoProjectIteratorfor enumerating Rust package directories under a working directory. - Updated
buildandcleanactions to use the iterator for validation and per-package processing. - Added unit tests for the new iterator.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/cargo-wdk/src/actions/mod.rs | Registers the new internal cargo_project_iterator module. |
| crates/cargo-wdk/src/actions/clean/mod.rs | Replaces manual directory scanning with CargoProjectIterator for emulated workspace clean. |
| crates/cargo-wdk/src/actions/cargo_project_iterator.rs | Implements and tests a reusable iterator over Cargo project subdirectories. |
| crates/cargo-wdk/src/actions/build/mod.rs | Replaces manual directory scanning with CargoProjectIterator for emulated workspace build. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
CargoProjectIteratorfor immediate subdirectories containingCargo.tomlFixes #644
Testing
cargo test -p cargo-wdk --bin cargo-wdk --locked(104/104 pass)cargo clippy -p cargo-wdk --locked --all-targets -- -D warningsgit diff --checkcargoon child-process PATH; the unit/action coverage above is green.