-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix formatting in allowed values for gh config --help
#11003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the formatting of allowed values and default values in the gh config --help output to use code ticks and clearer separators.
- Wrap allowed values in
`{…}`with spaces around the pipe. - Wrap default values in code ticks.
Comments suppressed due to low confidence (2)
pkg/cmd/config/config.go:23
- Add or update tests for
gh config --helpto verify the new code-formatted allowed values (e.g.,{val1 | val2}) appear as expected.
longDoc.WriteString(fmt.Sprintf(" `{%s}`", strings.Join(co.AllowedValues, " | ")))
pkg/cmd/config/config.go:26
- Add or update tests to ensure the default value is enclosed in backticks in the help output.
longDoc.WriteString(fmt.Sprintf(" (default `%s`)", co.DefaultValue))
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the formatting of allowed and default values in gh config --help, adds a compatibility test for Kramdown quirks in command help text, and updates dependencies for the new Markdown parser.
- Wrap allowed values and default values in backticks with spaces around pipe separators
- Introduce
TestKramdownCompatibleDocsto ensure no stray pipes appear outside code blocks/spans - Add
github.com/yuin/goldmarktogo.modand remove a duplicate entry
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/cmd/config/config.go | Wrap allowed and default values in backticks for help documentation |
| pkg/cmd/root/help_test.go | Add Kramdown compatibility test to check pipe usage in help docs |
| go.mod | Include goldmark dependency and remove duplicate entry |
Comments suppressed due to low confidence (1)
pkg/cmd/config/config.go:23
- There are no tests verifying the new backtick formatting for allowed values and default values in the
gh config --helpoutput. Consider adding a test to assert that allowed values (and defaults) are correctly wrapped in backticks and spaced as expected.
longDoc.WriteString(fmt.Sprintf(" `{%s}`", strings.Join(co.AllowedValues, " | ")))
Signed-off-by: Babak K. Shandiz <[email protected]>
babakks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [cli/cli](https://github.com/cli/cli) | minor | `v2.73.0` -> `v2.74.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>cli/cli (cli/cli)</summary> ### [`v2.74.1`](https://github.com/cli/cli/releases/tag/v2.74.1): GitHub CLI 2.74.1 [Compare Source](cli/cli@v2.74.0...v2.74.1) #### What's Changed - Document support for `@copilot` in `gh [pr|issue] edit --add-assignee` and `--remove-assignee` by [@​timrogers](https://github.com/timrogers) in cli/cli#11056 - Fix pr edit when URL is provided by [@​williammartin](https://github.com/williammartin) in cli/cli#11057 - Fix const in MR finder tests by [@​babakks](https://github.com/babakks) in cli/cli#11091 **Full Changelog**: cli/cli@v2.74.0...v2.74.1 ### [`v2.74.0`](https://github.com/cli/cli/releases/tag/v2.74.0): GitHub CLI 2.74.0 [Compare Source](cli/cli@v2.73.0...v2.74.0) #### Security A security vulnerability has been identified in a core `gh` dependency, `go-gh`, where an attacker-controlled GitHub Enterprise Server could result in executing arbitrary commands on a user's machine by replacing HTTP URLs provided by GitHub with local file paths for browsing. This issue is addressed in this `gh` release by updating `go-gh` to a fixed version. For more information, see GHSA-g9f5-x53j-h563 #### What's changed ##### ✨ Features - Add `preview prompter` command by [@​BagToad](https://github.com/BagToad) in cli/cli#10745 - \[gh run watch] Support `--compact` flag by [@​iamazeem](https://github.com/iamazeem) in cli/cli#10629 - Fix brew update notifications by [@​BagToad](https://github.com/BagToad) in cli/cli#11024 ##### 🐛 Fixes - Revert "\[gh config] Escape pipe symbol in Long desc for website manual" by [@​BagToad](https://github.com/BagToad) in cli/cli#11004 - Fix formatting in allowed values for `gh config --help` by [@​BagToad](https://github.com/BagToad) in cli/cli#11003 - fix: `gh gist edit` panic when no file in a gist by [@​phanen](https://github.com/phanen) in cli/cli#10627 - Add retry logic when fetching TUF content in `gh attestation` commands by [@​malancas](https://github.com/malancas) in cli/cli#10943 ##### 📚 Docs & Chores - Update README.md by [@​irhdab](https://github.com/irhdab) in cli/cli#11022 - Add tests for `RenderJobs` and `RenderJobsCompact` by [@​babakks](https://github.com/babakks) in cli/cli#11013 - Add example usage of `--head` option to `pr list` docs by [@​babakks](https://github.com/babakks) in cli/cli#10979 - Mention `pr create` will print the created MR's URL by [@​babakks](https://github.com/babakks) in cli/cli#10980 - Add Digest to ReleaseAsset struct by [@​bdehamer](https://github.com/bdehamer) in cli/cli#11030 #####Dependencies - Bump `go-gh` to v2.12.1 by [@​BagToad](https://github.com/BagToad) in cli/cli#11043 - chore(deps): bump github.com/gabriel-vasile/mimetype from 1.4.8 to 1.4.9 by [@​dependabot](https://github.com/dependabot) in cli/cli#10825 - Update sigstore-go dependency to v1.0.0 by [@​malancas](https://github.com/malancas) in cli/cli#11028 - chore(deps): bump github.com/sigstore/protobuf-specs from 0.4.1 to 0.4.2 by [@​dependabot](https://github.com/dependabot) in cli/cli#10999 - chore(deps): bump github.com/yuin/goldmark from 1.7.8 to 1.7.12 by [@​dependabot](https://github.com/dependabot) in cli/cli#11032 #### New Contributors - [@​irhdab](https://github.com/irhdab) made their first contribution in cli/cli#11022 - [@​phanen](https://github.com/phanen) made their first contribution in cli/cli#10627 **Full Changelog**: cli/cli@v2.73.0...v2.74.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC41MC4wIiwidXBkYXRlZEluVmVyIjoiNDAuNTAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Part of a fix for #10678