-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Add repo license list/view and repo gitignore list/view
#9721
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
Add repo license list/view and repo gitignore list/view
#9721
Conversation
Because the API query uses REST, the JSON exporter doesn't work as expected.
andyfeller
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.
I'm sure gh users will be happy for this information readily at hand! ✨
No major concerns but a range of various minor or middling nits. 🙇
Co-authored-by: Andy Feller <andyfeller@github.com>
79b617a to
c2a7756
Compare
Licenses are no longer referred to as templates. Prefix the new license and gitignore functions with "Repo" as a more descriptive name.
fe152bc to
d6c6c6b
Compare
Updated `Use` to indicate that args can be an SPDX ID or license key. Improved the examples docs to show the use of both.
|
@andyfeller This is ready for another pass please 🙏 I've implemented most of your suggestions. There are a few unresolved comments that need more discussion. |
…https://github.com/cli/cli into bagtoad/cli-8946-list-licenses-and-gitignore-options
andyfeller
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.
Final round of minor nits, primarily around language. Happy to knock this out with you today if you like.
Co-authored-by: Andy Feller <andyfeller@github.com>
andyfeller
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.
✨ 👨🍳 💋
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. @probablycorey @matschaffer @digitalfu cli#9745 cli#9721 cli#9728 cli#9746 №accuweaty24 #
|
User feedback FWIW: reading v2.59.0 |
Or maybe even by adding |
@yermulnik : I'd love to follow up within the original issue or a new issue about your ideas on what Normally, I'd say |
Apologies if I wasn't clear enough: this is not about handling
This was the gist of my comment: the word "templates", that you used to make thought clear, is missing from the added sub-commands and this adds a bit of confusion I guess. |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [cli/cli](https://github.com/cli/cli) | minor | `v2.58.0` -> `v2.59.0` | 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.59.0`](https://github.com/cli/cli/releases/tag/v2.59.0): GitHub CLI 2.59.0 [Compare Source](cli/cli@v2.58.0...v2.59.0) #### What's Changed - Allow community submitted design work by [@​BagToad](https://github.com/BagToad) in cli/cli#9683 - Improve `SECURITY.md` with expectations for privately reported vulnerabilities by [@​BagToad](https://github.com/BagToad) in cli/cli#9687 - Emit a log message when extension installation falls back to a `darwin-amd64` binary on an Apple Silicon macOS device by [@​timrogers](https://github.com/timrogers) in cli/cli#9650 - Print the login URL even when opening a browser by [@​ulfjack](https://github.com/ulfjack) in cli/cli#7091 - configurable maxwidth for markdown WithWrap() by [@​smemsh](https://github.com/smemsh) in cli/cli#9626 - Handle errors when parsing hostname in auth flow by [@​BagToad](https://github.com/BagToad) in cli/cli#9729 - Add `repo license list/view` and `repo gitignore list/view` by [@​BagToad](https://github.com/BagToad) in cli/cli#9721 - Introduce testscript acceptance tests generally, and for the MR command specifically by [@​williammartin](https://github.com/williammartin) in cli/cli#9745 - Support `GH_ACCEPTANCE_SCRIPT` env var to target a single script by [@​williammartin](https://github.com/williammartin) in cli/cli#9756 - Ensure Acceptance defer failures are debuggable by [@​williammartin](https://github.com/williammartin) in cli/cli#9754 - Add acceptance task to makefile by [@​williammartin](https://github.com/williammartin) in cli/cli#9748 - Add Acceptance tests for `issue` command by [@​williammartin](https://github.com/williammartin) in cli/cli#9757 - Update IsEnterprise and IsTenancy for orthogonality using go-gh by [@​jtmcg](https://github.com/jtmcg) in cli/cli#9755 - Supporting filtering on `gist list` by [@​heaths](https://github.com/heaths) in cli/cli#9728 #### New Contributors - [@​ulfjack](https://github.com/ulfjack) made their first contribution in cli/cli#7091 - [@​smemsh](https://github.com/smemsh) made their first contribution in cli/cli#9626 **Full Changelog**: cli/cli@v2.58.0...v2.59.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:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
This PR resolves #8946 according to the interface described in #8946 (comment)
Examples
gh repo license listDetails
gh repo license view <license>Details
gh repo gitignore listDetails
Note: truncated screenshot because the list is long.
gh repo gitignore view <gitignore-template>Details
Note: truncated screenshot because the output is long.
Notes
listLicenseTemplatesandlistGitIgnoreTemplatesfound here:cli/pkg/cmd/repo/create/http.go
Lines 342 to 362 in d645fd4
queries_repo.go. I felt this made the most sense sincegh repo createuses these methods as well.gitignore listis a single column, I felt it would make sense to use the same tableprinter anyway.You may notice that this PR renamesThis was reversed.sharedtoformatinpkg/cmd/repo/create/create.go- this is because I had originally missed that there were many queries inqueries_repo.go; instead of usingqueries_repo.go, I had implemented queries in a package undershared, which prompted me to splitsharedintoformatandqueriesto better organize the code. However, I later removedquerieswhen I realized aboutqueries_repo.go, but decided to leaveformatas a changed package to align more closely with the package structure found in some other examples like https://github.com/cli/cli/tree/d645fd4f0066d96b1e5ef37089192f0d33ba9b84/pkg/cmd/project/shared/formatFeedback
I would love constructive feedback on anything, but I am particularly interested in:
Do you agree/disagree with the rename of thesharedpackage to format? See Notes section above for more info.This was reversed.