refactor(cargo-wdk): share project directory iteration - #722
refactor(cargo-wdk): share project directory iteration#722ITSMESB (ITSMERNB) wants to merge 1 commit into
Conversation
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.
Signed-off-by: ITSMESB <131141975+ITSMERNB@users.noreply.github.com>
598ff3f to
5199e09
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The refactor is localized, removes duplicated logic, preserves existing behavior, and is backed by targeted unit tests for the new iterator.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
Rebased this onto the current |
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.