fix(add): clarify --allow-build help and let it flip an existing deny#660
Conversation
Previously `aube add --help` rendered the flag as `--allow-build[=<PKG>]` — the bracketed `[=<PKG>]` reads as "value optional" but the bare form was rejected (Discussion #655). Dropped the `num_args = 0..=1` + `default_missing_value` wiring so the help line now reads `--allow-build=<PKG>` and bare gets clap's "equal sign is needed" diagnostic. The explicit empty form `--allow-build=` still emits pnpm's verbatim "missing a package name" message. Also: - `--allow-build=<pkg>` no longer errors when `allowBuilds: <pkg>: false` already exists. The user is passing the flag deliberately, so flipping the value is what they want; the prior "explicit deny conflict" check just forced them to hand-edit yaml to get the same effect. - Trimmed the over-detailed doc comments on `--allow-build`. - Hid `--ignore-scripts` on `add`, `import`, and `update` where it is a documented no-op (still visible on `version`, `pack`, `ci`, `remove`, where it actually does something). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes the misleading
Confidence Score: 5/5Safe to merge — changes are narrow, well-tested, and deliberate. The core logic change (flipping a pre-existing No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "test(add): make --allow-build flip-test ..." | Re-trigger Greptile |
Established pattern in this file (lines 680, 890) uses `['"]?:` to accept both quoted and bare yaml keys. The flip test I added in the prior commit used the stricter `":` form, so if `add_to_allow_builds` ever reserializes with a different quoting style the assertion would silently pass `run` but fail `assert_success`. Caught in PR review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Addresses Discussion #655:
aube add --helprendered--allow-buildas--allow-build[=<PKG>], where the bracketed[=<PKG>]reads as "value optional" but the bare form was rejected.num_args = 0..=1+default_missing_valuewiring so--helpnow shows--allow-build=<PKG>(no brackets). Bare--allow-buildnow gets clap's standardequal sign is needed when assigning values to '--allow-build=<PKG>'diagnostic — clearer than the prior pnpm-verbatim "missing a package name" wording. The explicit empty form--allow-build=still goes through the validator and keeps pnpm's verbatim message.--allow-build=<pkg>no longer errors on existingallowBuilds: <pkg>: false. It now flips the value silently. The flag is a deliberate user action; treating it as a conflict just forced users to hand-edit yaml for the same effect.--allow-buildfield doc.--ignore-scriptshidden where it's a no-op. Markedhide = trueonadd,import, andupdate. Still visible onversion,pack,ci, andremove, where it actually does something.Test plan
cargo clippy -p aube --all-targets -- -D warnings— cleancargo fmt --check— cleancargo test -p aube— 482 unit tests passlifecycle_scripts.bats,allow_builds.bats,global_install.bats— no failuresaube add --helpshows--allow-build=<PKG>(no brackets) and omits--ignore-scriptsaube version --helpetc. still list--ignore-scripts🤖 Generated with Claude Code
Note
Medium Risk
Changes how
--allow-buildis parsed and how it mutatesallowBuilds, which affects whether dependency lifecycle scripts are allowed to run. Risk is mitigated by updated bats coverage, but it still touches script-approval behavior.Overview
Tightens
aube add --allow-buildparsing so help/rendering matches the required--allow-build=<PKG>form and bare/space forms now fail with clap’s clearer “equal sign is needed” diagnostic (while--allow-build=still produces pnpm-verbatim wording).Updates
--allow-build=<pkg>application to overwrite existingallowBuildsentries (including flipping an existingfalsetotrue) instead of erroring on prior denies.Hides no-op
--ignore-scriptsflags inadd,import, andupdate, and regenerates CLI docs/spec JSON accordingly; tests are updated to reflect the new diagnostics and flip behavior.Reviewed by Cursor Bugbot for commit 8149ffb. Bugbot is set up for automated code reviews on this repo. Configure here.