feat: add --json flag as no-op alias for --format json#1104
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe PR introduces a ChangesJSON flag shorthand
🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
68c5eee to
9729b11
Compare
|
Actionable comments posted: 0 |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@882be9da73cba6c8ee3296f7a1ee963c52780cf6🧩 Skill updatenpx skills add MaxHuang22/cli#feat/secret-medallion -y -g |
Skip registration when a custom --json flag already exists on the command (e.g. base shortcuts use --json for body input).
9729b11 to
882be9d
Compare
|
Actionable comments posted: 0 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1104 +/- ##
=======================================
Coverage 68.64% 68.64%
=======================================
Files 625 625
Lines 58389 58393 +4
=======================================
+ Hits 40079 40082 +3
- Misses 15023 15025 +2
+ Partials 3287 3286 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
AI agents frequently pass
--jsonwhen calling lark-cli commands, causing "unknown flag" errors. This adds--jsonas a no-op bool flag to api, service, and shortcut (HasFormat) commands so the flag is silently accepted. Since--formatalready defaults tojson, no behavioral wiring is needed.Changes
cmd.Flags().Bool("json", ...)tocmd/api/api.goafter--formatregistrationcmd.Flags().Bool("json", ...)tocmd/service/service.goafter--formatregistrationcmd.Flags().Bool("json", ...)toshortcuts/common/runner.goinsideHasFormatblock, with aLookup("json")guard to skip registration when a custom--jsonflag already exists (e.g. base domain shortcuts use--jsonfor body input)Test Plan
make unit-testpassedlark-cli api GET /open-apis/test --json --dry-runaccepted without error;lark-cli calendar +agenda --json --helpshows--jsonflagRelated Issues
N/A
Summary by CodeRabbit
New Features
Tests