fix: standardize CLI shortcut text in English#1942
Conversation
📝 WalkthroughWalkthroughThis PR removes the localized permission hint from ChangesPermission and text updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@45647c5571ce3ba28739340291532fece5cad3ba🧩 Skill updatenpx skills add larksuite/cli#chore/lang -y -g |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shortcuts/doc/docs_create_test.go`:
- Around line 176-178: Strengthen the text assertions in
shortcuts/doc/docs_create_test.go:176-178 by comparing grant["message"] against
the complete standardized failure message rather than checking only for
“full_access”. Also update shortcuts/drive/drive_create_folder_test.go:89-95 to
assert the decoded dry-run Desc value exactly, preserving the existing test flow
and expected output contract.
In `@shortcuts/drive/drive_import_test.go`:
- Line 111: Update shortcuts/drive/drive_import_test.go:111 to assert the exact
expected bot-mode Desc value, and update
shortcuts/drive/drive_io_test.go:1103-1104 to assert the exact expected
PostUploadNote value in their respective decoded dry-run responses. Keep the
existing decoding and test flow unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c7d8771b-57e7-4e88-a90f-bcbe894d9ec5
📒 Files selected for processing (24)
shortcuts/common/permission_grant.goshortcuts/common/permission_grant_test.goshortcuts/doc/docs_create_test.goshortcuts/doc/docs_create_v2.goshortcuts/doc/docs_fetch_im_markdown.goshortcuts/doc/docs_fetch_im_markdown_test.goshortcuts/doc/docs_fetch_v2.goshortcuts/doc/docs_fetch_v2_test.goshortcuts/doc/docs_update_v2.goshortcuts/doc/html5_block_resources_test.goshortcuts/drive/drive_add_comment.goshortcuts/drive/drive_create_folder.goshortcuts/drive/drive_create_folder_test.goshortcuts/drive/drive_import.goshortcuts/drive/drive_import_test.goshortcuts/drive/drive_io_test.goshortcuts/drive/drive_permission_grant_test.goshortcuts/drive/drive_upload.goshortcuts/drive/shortcuts_test.goshortcuts/sheets/backward/lark_sheets_sheet_create_test.goshortcuts/sheets/backward/lark_sheets_spreadsheet_management.goshortcuts/slides/slides_create.goshortcuts/wiki/wiki_node_create.goshortcuts/wiki/wiki_node_create_test.go
|
|
||
| var got struct { | ||
| API []struct { | ||
| Desc string `json:"desc"` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert newly added dry-run fields directly.
Both tests decode new response fields without checking their values, so they can pass while the user-facing dry-run text is missing or incorrect. As per coding guidelines, add exact assertions for each field.
shortcuts/drive/drive_import_test.go#L111-L111: assert the expected bot-modeDesc.shortcuts/drive/drive_io_test.go#L1103-L1104: assert the expectedPostUploadNote.
📍 Affects 2 files
shortcuts/drive/drive_import_test.go#L111-L111(this comment)shortcuts/drive/drive_io_test.go#L1103-L1104
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@shortcuts/drive/drive_import_test.go` at line 111, Update
shortcuts/drive/drive_import_test.go:111 to assert the exact expected bot-mode
Desc value, and update shortcuts/drive/drive_io_test.go:1103-1104 to assert the
exact expected PostUploadNote value in their respective decoded dry-run
responses. Keep the existing decoding and test flow unchanged.
Source: Coding guidelines
- translate Docs create and update help descriptions - remove localized permission annotations - replace Chinese examples and fallback text - use English labels for Docs IM Markdown resources - update regression tests for English output
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shortcuts/drive/drive_create_folder_test.go`:
- Line 93: Update the test’s final API assertions to directly verify the decoded
Desc field with an exact expected dry-run text string. Use the existing decoded
response variable and assertion style, ensuring the newly added Desc contract is
validated alongside the other fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d188a996-66ba-4d02-ab1d-472aa71bac57
📒 Files selected for processing (26)
shortcuts/base/base_execute_test.goshortcuts/base/base_ops.goshortcuts/common/permission_grant.goshortcuts/common/permission_grant_test.goshortcuts/doc/docs_create_test.goshortcuts/doc/docs_create_v2.goshortcuts/doc/docs_fetch_im_markdown.goshortcuts/doc/docs_fetch_im_markdown_test.goshortcuts/doc/docs_fetch_v2.goshortcuts/doc/docs_fetch_v2_test.goshortcuts/doc/docs_update_v2.goshortcuts/doc/html5_block_resources_test.goshortcuts/drive/drive_add_comment.goshortcuts/drive/drive_create_folder.goshortcuts/drive/drive_create_folder_test.goshortcuts/drive/drive_import.goshortcuts/drive/drive_import_test.goshortcuts/drive/drive_io_test.goshortcuts/drive/drive_permission_grant_test.goshortcuts/drive/drive_upload.goshortcuts/drive/shortcuts_test.goshortcuts/sheets/backward/lark_sheets_sheet_create_test.goshortcuts/sheets/backward/lark_sheets_spreadsheet_management.goshortcuts/slides/slides_create.goshortcuts/wiki/wiki_node_create.goshortcuts/wiki/wiki_node_create_test.go
🚧 Files skipped from review as they are similar to previous changes (23)
- shortcuts/sheets/backward/lark_sheets_spreadsheet_management.go
- shortcuts/common/permission_grant_test.go
- shortcuts/drive/drive_add_comment.go
- shortcuts/doc/docs_fetch_v2.go
- shortcuts/wiki/wiki_node_create.go
- shortcuts/doc/docs_update_v2.go
- shortcuts/doc/docs_fetch_im_markdown_test.go
- shortcuts/drive/drive_permission_grant_test.go
- shortcuts/base/base_ops.go
- shortcuts/doc/html5_block_resources_test.go
- shortcuts/doc/docs_create_v2.go
- shortcuts/wiki/wiki_node_create_test.go
- shortcuts/drive/drive_io_test.go
- shortcuts/doc/docs_create_test.go
- shortcuts/drive/drive_create_folder.go
- shortcuts/slides/slides_create.go
- shortcuts/drive/drive_upload.go
- shortcuts/doc/docs_fetch_im_markdown.go
- shortcuts/common/permission_grant.go
- shortcuts/sheets/backward/lark_sheets_sheet_create_test.go
- shortcuts/drive/drive_import.go
- shortcuts/doc/docs_fetch_v2_test.go
- shortcuts/base/base_execute_test.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1942 +/- ##
==========================================
+ Coverage 74.96% 75.03% +0.06%
==========================================
Files 892 894 +2
Lines 94077 94294 +217
==========================================
+ Hits 70529 70752 +223
+ Misses 18137 18134 -3
+ Partials 5411 5408 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Standardize user-facing shortcut help text, examples, permission messages, and generated resource labels in English across Docs, Drive, Sheets, Slides, and Wiki. Raw API/schema output and user-provided content are unchanged.
Changes
--reference-maphelp description and keyword example into English.任务→Task群聊卡片→Chat card多维表格→Basefull_accesspermission messages, help tips, and dry-run output.Test Plan
lark-cli <domain> <command>flow works as expected.gofmt -lreports no formatting issues in the modified Go files.git diff --checkpasses.Related Issues
Summary by CodeRabbit
full_access(without any extra parenthetical hint).--file-tokennot changing permissions on existing files.--reference-maphelp text plus related fetch/im-markdown label and expected output updates.full_accessis used as-is.