Parse KCL measurement units consistently - #1844
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1844 +/- ##
==========================================
+ Coverage 66.18% 66.62% +0.44%
==========================================
Files 43 43
Lines 8451 8563 +112
==========================================
+ Hits 5593 5705 +112
Misses 2858 2858
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
adamchalmers
left a comment
There was a problem hiding this comment.
Pls do not merge, hold for proper review
|
Please retarget this branch to deserialize command-line args for UoM via the kittycad-modeling-cmds crate (released in version 0.2.229) rather than implementing conversions between them. |
|
kcmc v0.2.229 was released with the clap derive now so you can remove the crates.io patch. Why does only volume need special treatment here, should this apply to all units? Genuine question. |
Merge current main, remove the modeling-command Git patch, and require the published unit-parsing compatibility fixes. Retain main's locked 0.2.231 and refresh the Nix vendor hash.
KCL measurement arguments parse directly into the modeling-command unit enums for volume, mass, density, surface area, center of mass, bounding boxes, and combined analysis. Enable the crate's
clapfeature and requirekittycad-modeling-cmds >= 0.2.230, which includes volume'sValueEnumsupport and preserves existing unit abbreviations, defaults, and density aliases. The lockfile retains the published0.2.231already used by currentmain; the temporary Git patch and volume conversion helper are gone.Regression coverage exercises all 14 measurement-unit flags: 71 accepted flag/value combinations and 14 invalid-value diagnostics with the exact available choices. It also checks file/KCL volume parity, analysis defaults, and all six density spellings across four flags.
Validation:
cargo test cmd_kcl::tests:: --locked --offline: 7 passed, 0 failed.cargo clippy --all-features --all-targets --locked --offline -- -D warnings: passed.cargo fmt --all -- --checkandgit diff --check: passed.main's existing hash. Full Nix builds run in CI.The local tests exercise command parsing and settings without live Engine/API requests.
Fixes #1744