docs: warn about zsh ! history expansion in sheet range examples#412
docs: warn about zsh ! history expansion in sheet range examples#412anshul-garg27 wants to merge 2 commits intogoogleworkspace:mainfrom
Conversation
Add a "Shell Tips" section to the gws-shared skill explaining that zsh interprets \! inside single quotes as history expansion, which mangles sheet ranges like 'Sheet1\!A1:B2'. Replace single quotes with double quotes around sheet ranges containing \! in: - registry/recipes.yaml (source for generated recipe skills) - src/helpers/sheets.rs (+read after_help examples) - src/generate_skills.rs (shared skill template) - Generated SKILL.md files for affected recipes and gws-sheets-read Closes googleworkspace#268
🦋 Changeset detectedLatest commit: 9511a63 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a compatibility issue where zsh's history expansion feature would incorrectly interpret sheet ranges containing Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an important shell compatibility issue with zsh by updating documentation and examples to use double quotes for sheet ranges containing !. The changes are mostly correct and well-implemented across the various documentation and source files. However, I've found a critical issue in src/helpers/sheets.rs where an unescaped double quote in a string literal will break the build. Please address this to ensure the code remains compilable.
src/helpers/sheets.rs
Outdated
| "\ | ||
| EXAMPLES: | ||
| gws sheets +read --spreadsheet ID --range 'Sheet1!A1:D10' | ||
| gws sheets +read --spreadsheet ID --range "Sheet1!A1:D10" |
There was a problem hiding this comment.
The use of an unescaped double quote " within this string literal will cause a compilation error. Since the string literal is defined with double quotes, any double quotes inside it must be escaped with a backslash (\).
| gws sheets +read --spreadsheet ID --range "Sheet1!A1:D10" | |
| gws sheets +read --spreadsheet ID --range \"Sheet1!A1:D10\" |
The after_help string for +read uses a regular string literal, not a raw string, so inner double quotes must be escaped with backslashes.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a shell compatibility issue with zsh where ! in sheet ranges is interpreted as history expansion. The fix, which replaces single quotes with double quotes in example commands across documentation and recipes, is applied consistently. A new "Shell Tips" section is also added to explain the issue to users. I have one suggestion to improve the clarity of this new documentation section.
|
|
||
| ## Shell Tips | ||
|
|
||
| - **zsh `!` expansion:** Sheet ranges like `Sheet1!A1` contain `!` which zsh interprets as history expansion. Use double quotes with escaped inner quotes instead of single quotes: |
There was a problem hiding this comment.
The explanation for zsh ! expansion is a bit confusing. It says "Use double quotes with escaped inner quotes instead of single quotes", but the example that follows simply replaces single quotes with double quotes and contains no inner quotes. This phrasing could be misleading for users. A simpler explanation would be more accurate and easier to understand.
| - **zsh `!` expansion:** Sheet ranges like `Sheet1!A1` contain `!` which zsh interprets as history expansion. Use double quotes with escaped inner quotes instead of single quotes: | |
| - **zsh `!` expansion:** Sheet ranges like `Sheet1!A1` contain `!` which zsh interprets as history expansion. To prevent this, use double quotes instead of single quotes around the argument: |
Summary
gws-sharedskill template explaining zsh!history expansion!in recipe sources and skill examplesProblem
zsh interprets
!inside single-quoted strings as history expansion. Running commands like:gws sheets +read --spreadsheet ID --range 'Sheet1!A1:D10'produces
Invalid --params JSONerrors because zsh mangles the value beforegwsreceives it.Changes
src/generate_skills.rssrc/helpers/sheets.rs+readafter_help exampleregistry/recipes.yamlskills/gws-shared/SKILL.mdskills/gws-sheets-read/SKILL.mdskills/recipe-*/SKILL.md(4 files)Test plan
registry/recipes.yaml(source), not just generated filesgenerate_skills.rs!patterns changed — Gmail/Chat!at end of sentences left as-is (safe in zsh)Closes #268