diff --git a/api/queries_issue.go b/api/queries_issue.go index 62531e84e..094b6b198 100644 --- a/api/queries_issue.go +++ b/api/queries_issue.go @@ -286,7 +286,7 @@ func IssueStatus(client *Client, repo ghrepo.Interface, options IssueStatusOptio } } } - }` + }` variables := map[string]interface{}{ "owner": repo.RepoOwner(), diff --git a/api/query_builder.go b/api/query_builder.go index 30dbeb869..755179396 100644 --- a/api/query_builder.go +++ b/api/query_builder.go @@ -152,13 +152,13 @@ func StatusCheckRollupGraphQLWithCountByState() string { contexts { checkRunCount, checkRunCountsByState { - state, - count + state, + count }, statusContextCount, statusContextCountsByState { - state, - count + state, + count } } } diff --git a/pkg/cmd/attestation/attestation.go b/pkg/cmd/attestation/attestation.go index ea1e0c08c..a6229e636 100644 --- a/pkg/cmd/attestation/attestation.go +++ b/pkg/cmd/attestation/attestation.go @@ -18,7 +18,7 @@ func NewCmdAttestation(f *cmdutil.Factory) *cobra.Command { Aliases: []string{"at"}, Long: heredoc.Doc(` Download and verify artifact attestations. - `), + `), } root.AddCommand(download.NewDownloadCmd(f, nil)) diff --git a/pkg/cmd/attestation/trustedroot/trustedroot.go b/pkg/cmd/attestation/trustedroot/trustedroot.go index 09ab9a6c9..e28ceab62 100644 --- a/pkg/cmd/attestation/trustedroot/trustedroot.go +++ b/pkg/cmd/attestation/trustedroot/trustedroot.go @@ -32,22 +32,22 @@ func NewTrustedRootCmd(f *cmdutil.Factory, runF func(*Options) error) *cobra.Com Long: heredoc.Docf(` ### NOTE: This feature is currently in beta, and subject to change. - Output contents for a trusted_root.jsonl file, likely for offline verification. + Output contents for a trusted_root.jsonl file, likely for offline verification. - When using %[1]sgh attestation verify%[1]s, if your machine is on the internet, - this will happen automatically. But to do offline verification, you need to - supply a trusted root file with %[1]s--custom-trusted-root%[1]s; this command - will help you fetch a %[1]strusted_root.jsonl%[1]s file for that purpose. + When using %[1]sgh attestation verify%[1]s, if your machine is on the internet, + this will happen automatically. But to do offline verification, you need to + supply a trusted root file with %[1]s--custom-trusted-root%[1]s; this command + will help you fetch a %[1]strusted_root.jsonl%[1]s file for that purpose. - You can call this command without any flags to get a trusted root file covering - the Sigstore Public Good Instance as well as GitHub's Sigstore instance. + You can call this command without any flags to get a trusted root file covering + the Sigstore Public Good Instance as well as GitHub's Sigstore instance. - Otherwise you can use %[1]s--tuf-url%[1]s to specify the URL of a custom TUF - repository mirror, and %[1]s--tuf-root%[1]s should be the path to the - %[1]sroot.json%[1]s file that you securely obtained out-of-band. + Otherwise you can use %[1]s--tuf-url%[1]s to specify the URL of a custom TUF + repository mirror, and %[1]s--tuf-root%[1]s should be the path to the + %[1]sroot.json%[1]s file that you securely obtained out-of-band. - If you just want to verify the integrity of your local TUF repository, and don't - want the contents of a trusted_root.jsonl file, use %[1]s--verify-only%[1]s. + If you just want to verify the integrity of your local TUF repository, and don't + want the contents of a trusted_root.jsonl file, use %[1]s--verify-only%[1]s. `, "`"), Example: heredoc.Doc(` # Get a trusted_root.jsonl for both Sigstore Public Good and GitHub's instance diff --git a/pkg/cmd/codespace/ssh.go b/pkg/cmd/codespace/ssh.go index 571f74267..c6c3943e2 100644 --- a/pkg/cmd/codespace/ssh.go +++ b/pkg/cmd/codespace/ssh.go @@ -60,7 +60,7 @@ func newSSHCmd(app *App) *cobra.Command { The %[1]sssh%[1]s command will automatically create a public/private ssh key pair in the %[1]s~/.ssh%[1]s directory if you do not have an existing valid key pair. When selecting the key pair to use, the preferred order is: - + 1. Key specified by %[1]s-i%[1]s in %[1]s%[1]s 2. Automatic key, if it already exists 3. First valid key pair in ssh config (according to %[1]sssh -G%[1]s) diff --git a/pkg/cmd/pr/list/list.go b/pkg/cmd/pr/list/list.go index 7721ecc1b..93a9b8b4b 100644 --- a/pkg/cmd/pr/list/list.go +++ b/pkg/cmd/pr/list/list.go @@ -72,7 +72,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman Find a PR that introduced a given commit $ gh pr list --search "" --state merged - `), + `), Aliases: []string{"ls"}, Args: cmdutil.NoArgsQuoteReminder, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/cmd/pr/merge/merge.go b/pkg/cmd/pr/merge/merge.go index 1e7deabcb..e3d1a14ee 100644 --- a/pkg/cmd/pr/merge/merge.go +++ b/pkg/cmd/pr/merge/merge.go @@ -88,7 +88,7 @@ func NewCmdMerge(f *cmdutil.Factory, runF func(*MergeOptions) error) *cobra.Comm If required checks have not yet passed, auto-merge will be enabled. If required checks have passed, the pull request will be added to the merge queue. To bypass a merge queue and merge directly, pass the %[1]s--admin%[1]s flag. - `, "`"), + `, "`"), Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { opts.Finder = shared.NewFinder(f) diff --git a/pkg/cmd/pr/status/http.go b/pkg/cmd/pr/status/http.go index bd7eb6a78..1eb12ed74 100644 --- a/pkg/cmd/pr/status/http.go +++ b/pkg/cmd/pr/status/http.go @@ -101,23 +101,23 @@ func pullRequestStatus(httpClient *http.Client, repo ghrepo.Interface, options r } query := fragments + queryPrefix + ` - viewerCreated: search(query: $viewerQuery, type: ISSUE, first: $per_page) { - totalCount: issueCount - edges { - node { - ...prWithReviews - } - } - } - reviewRequested: search(query: $reviewerQuery, type: ISSUE, first: $per_page) { - totalCount: issueCount - edges { - node { - ...pr - } - } - } - } + viewerCreated: search(query: $viewerQuery, type: ISSUE, first: $per_page) { + totalCount: issueCount + edges { + node { + ...prWithReviews + } + } + } + reviewRequested: search(query: $reviewerQuery, type: ISSUE, first: $per_page) { + totalCount: issueCount + edges { + node { + ...pr + } + } + } + } ` currentUsername := options.Username diff --git a/pkg/cmd/release/create/create.go b/pkg/cmd/release/create/create.go index 1cfc5ba06..95453250e 100644 --- a/pkg/cmd/release/create/create.go +++ b/pkg/cmd/release/create/create.go @@ -115,7 +115,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co Use release notes from a file $ gh release create v1.2.3 -F changelog.md - + Don't mark the release as latest $ gh release create v1.2.3 --latest=false diff --git a/pkg/cmd/repo/create/create.go b/pkg/cmd/repo/create/create.go index 05e8909e1..9074ea117 100644 --- a/pkg/cmd/repo/create/create.go +++ b/pkg/cmd/repo/create/create.go @@ -88,7 +88,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co To create a remote repository non-interactively, supply the repository name and one of %[1]s--public%[1]s, %[1]s--private%[1]s, or %[1]s--internal%[1]s. Pass %[1]s--clone%[1]s to clone the new repository locally. - If the %[1]sOWNER/%[1]s portion of the %[1]sOWNER/REPO%[1]s name argument is omitted, it + If the %[1]sOWNER/%[1]s portion of the %[1]sOWNER/REPO%[1]s name argument is omitted, it defaults to the name of the authenticating user. To create a remote repository from an existing local repository, specify the source directory with %[1]s--source%[1]s. diff --git a/pkg/cmd/repo/credits/credits.go b/pkg/cmd/repo/credits/credits.go index 4b7b9fb28..7db08a231 100644 --- a/pkg/cmd/repo/credits/credits.go +++ b/pkg/cmd/repo/credits/credits.go @@ -79,18 +79,18 @@ func NewCmdRepoCredits(f *cmdutil.Factory, runF func(*CreditsOptions) error) *co Use: "credits []", Short: "View credits for a repository", Example: heredoc.Doc(` - # view credits for the current repository - $ gh repo credits + # view credits for the current repository + $ gh repo credits - # view credits for a specific repository - $ gh repo credits cool/repo + # view credits for a specific repository + $ gh repo credits cool/repo - # print a non-animated thank you - $ gh repo credits -s + # print a non-animated thank you + $ gh repo credits -s - # pipe to just print the contributors, one per line - $ gh repo credits | cat - `), + # pipe to just print the contributors, one per line + $ gh repo credits | cat + `), Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { if len(args) > 0 { diff --git a/pkg/cmd/root/help_topic.go b/pkg/cmd/root/help_topic.go index 4786a993b..3da5bf476 100644 --- a/pkg/cmd/root/help_topic.go +++ b/pkg/cmd/root/help_topic.go @@ -158,25 +158,25 @@ var HelpTopics = []helpTopic{ $ gh pr list --json number,title,author [ { - "author": { - "login": "monalisa" - }, - "number": 123, - "title": "A helpful contribution" + "author": { + "login": "monalisa" + }, + "number": 123, + "title": "A helpful contribution" }, { - "author": { - "login": "codercat" - }, - "number": 124, - "title": "Improve the docs" + "author": { + "login": "codercat" + }, + "number": 124, + "title": "Improve the docs" }, { - "author": { - "login": "cli-maintainer" - }, - "number": 125, - "title": "An exciting new feature" + "author": { + "login": "cli-maintainer" + }, + "number": 125, + "title": "An exciting new feature" } ] @@ -193,32 +193,31 @@ var HelpTopics = []helpTopic{ | map(.labels = (.labels | map(.name))) # show only the label names | .[:3] # select the first 3 results' [ - { - "labels": [ - "enhancement", - "needs triage" - ], - "number": 123, - "title": "A helpful contribution" - }, - { - "labels": [ - "help wanted", - "docs", - "good first issue" - ], - "number": 125, - "title": "Improve the docs" - }, - { - "labels": [ - "enhancement", - ], - "number": 7221, - "title": "An exciting new feature" - } + { + "labels": [ + "enhancement", + "needs triage" + ], + "number": 123, + "title": "A helpful contribution" + }, + { + "labels": [ + "help wanted", + "docs", + "good first issue" + ], + "number": 125, + "title": "Improve the docs" + }, + { + "labels": [ + "enhancement", + ], + "number": 7221, + "title": "An exciting new feature" + } ] - # using the --template flag with the hyperlink helper gh issue list --json title,url --template '{{range .}}{{hyperlink .url .title}}{{"\n"}}{{end}}' diff --git a/pkg/cmd/run/download/download.go b/pkg/cmd/run/download/download.go index 993e16e52..18a10df80 100644 --- a/pkg/cmd/run/download/download.go +++ b/pkg/cmd/run/download/download.go @@ -51,17 +51,17 @@ func NewCmdDownload(f *cmdutil.Factory, runF func(*DownloadOptions) error) *cobr `), Args: cobra.MaximumNArgs(1), Example: heredoc.Doc(` - # Download all artifacts generated by a workflow run - $ gh run download + # Download all artifacts generated by a workflow run + $ gh run download - # Download a specific artifact within a run - $ gh run download -n + # Download a specific artifact within a run + $ gh run download -n - # Download specific artifacts across all runs in a repository - $ gh run download -n -n + # Download specific artifacts across all runs in a repository + $ gh run download -n -n - # Select artifacts to download interactively - $ gh run download + # Select artifacts to download interactively + $ gh run download `), RunE: func(cmd *cobra.Command, args []string) error { if len(args) > 0 { diff --git a/pkg/cmd/run/list/list.go b/pkg/cmd/run/list/list.go index 21e6c7faf..793bfbb85 100644 --- a/pkg/cmd/run/list/list.go +++ b/pkg/cmd/run/list/list.go @@ -58,7 +58,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman Use: "list", Short: "List recent workflow runs", Long: heredoc.Docf(` - List recent workflow runs. + List recent workflow runs. Note that providing the %[1]sworkflow_name%[1]s to the %[1]s-w%[1]s flag will not fetch disabled workflows. Also pass the %[1]s-a%[1]s flag to fetch disabled workflow runs using the %[1]sworkflow_name%[1]s and the %[1]s-w%[1]s flag. diff --git a/pkg/cmd/search/commits/commits.go b/pkg/cmd/search/commits/commits.go index 698e933bb..6a9f58b86 100644 --- a/pkg/cmd/search/commits/commits.go +++ b/pkg/cmd/search/commits/commits.go @@ -45,7 +45,7 @@ func NewCmdCommits(f *cmdutil.Factory, runF func(*CommitsOptions) error) *cobra. GitHub search syntax is documented at: - `), + `), Example: heredoc.Doc(` # search commits matching set of keywords "readme" and "typo" $ gh search commits readme typo @@ -64,7 +64,7 @@ func NewCmdCommits(f *cmdutil.Factory, runF func(*CommitsOptions) error) *cobra. # search commits authored before February 1st, 2022 $ gh search commits --author-date="<2022-02-01" - `), + `), RunE: func(c *cobra.Command, args []string) error { if len(args) == 0 && c.Flags().NFlag() == 0 { return cmdutil.FlagErrorf("specify search keywords or flags") diff --git a/pkg/cmd/search/issues/issues.go b/pkg/cmd/search/issues/issues.go index ec7909747..a8be32f71 100644 --- a/pkg/cmd/search/issues/issues.go +++ b/pkg/cmd/search/issues/issues.go @@ -34,7 +34,7 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c GitHub search syntax is documented at: - `), + `), Example: heredoc.Doc(` # search issues matching set of keywords "readme" and "typo" $ gh search issues readme typo @@ -56,8 +56,7 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c # search issues only from un-archived repositories (default is all repositories) $ gh search issues --owner github --archived=false - - `), + `), RunE: func(c *cobra.Command, args []string) error { if len(args) == 0 && c.Flags().NFlag() == 0 { return cmdutil.FlagErrorf("specify search keywords or flags") diff --git a/pkg/cmd/search/prs/prs.go b/pkg/cmd/search/prs/prs.go index 5da7b18f7..32565a580 100644 --- a/pkg/cmd/search/prs/prs.go +++ b/pkg/cmd/search/prs/prs.go @@ -36,7 +36,7 @@ func NewCmdPrs(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *cobr GitHub search syntax is documented at: - `), + `), Example: heredoc.Doc(` # search pull requests matching set of keywords "fix" and "bug" $ gh search prs fix bug @@ -58,7 +58,7 @@ func NewCmdPrs(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *cobr # search pull requests only from un-archived repositories (default is all repositories) $ gh search prs --owner github --archived=false - `), + `), RunE: func(c *cobra.Command, args []string) error { if len(args) == 0 && c.Flags().NFlag() == 0 { return cmdutil.FlagErrorf("specify search keywords or flags") diff --git a/pkg/cmd/search/repos/repos.go b/pkg/cmd/search/repos/repos.go index 26bee450e..88b8db13f 100644 --- a/pkg/cmd/search/repos/repos.go +++ b/pkg/cmd/search/repos/repos.go @@ -46,7 +46,7 @@ func NewCmdRepos(f *cmdutil.Factory, runF func(*ReposOptions) error) *cobra.Comm GitHub search syntax is documented at: - `), + `), Example: heredoc.Doc(` # search repositories matching set of keywords "cli" and "shell" $ gh search repos cli shell @@ -68,7 +68,7 @@ func NewCmdRepos(f *cmdutil.Factory, runF func(*ReposOptions) error) *cobra.Comm # search repositories excluding archived repositories $ gh search repos --archived=false - `), + `), RunE: func(c *cobra.Command, args []string) error { if len(args) == 0 && c.Flags().NFlag() == 0 { return cmdutil.FlagErrorf("specify search keywords or flags") diff --git a/pkg/cmd/variable/variable.go b/pkg/cmd/variable/variable.go index 15ff38744..920268c41 100644 --- a/pkg/cmd/variable/variable.go +++ b/pkg/cmd/variable/variable.go @@ -17,7 +17,7 @@ func NewCmdVariable(f *cmdutil.Factory) *cobra.Command { Long: heredoc.Docf(` Variables can be set at the repository, environment or organization level for use in GitHub Actions or Dependabot. Run %[1]sgh help variable set%[1]s to learn how to get started. - `, "`"), + `, "`"), } cmdutil.EnableRepoOverride(cmd, f) diff --git a/pkg/cmd/workflow/run/run.go b/pkg/cmd/workflow/run/run.go index 19c650984..b7ab53098 100644 --- a/pkg/cmd/workflow/run/run.go +++ b/pkg/cmd/workflow/run/run.go @@ -64,7 +64,7 @@ func NewCmdRun(f *cmdutil.Factory, runF func(*RunOptions) error) *cobra.Command - Interactively - Via %[1]s-f/--raw-field%[1]s or %[1]s-F/--field%[1]s flags - As JSON, via standard input - `, "`"), + `, "`"), Example: heredoc.Doc(` # Have gh prompt you for what workflow you'd like to run and interactively collect inputs $ gh workflow run diff --git a/pkg/cmd/workflow/view/view.go b/pkg/cmd/workflow/view/view.go index 28e561766..188d79e22 100644 --- a/pkg/cmd/workflow/view/view.go +++ b/pkg/cmd/workflow/view/view.go @@ -56,11 +56,11 @@ func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Comman Short: "View the summary of a workflow", Args: cobra.MaximumNArgs(1), Example: heredoc.Doc(` - # Interactively select a workflow to view - $ gh workflow view + # Interactively select a workflow to view + $ gh workflow view - # View a specific workflow - $ gh workflow view 0451 + # View a specific workflow + $ gh workflow view 0451 `), RunE: func(cmd *cobra.Command, args []string) error { // support `-R, --repo` override diff --git a/pkg/surveyext/editor.go b/pkg/surveyext/editor.go index 420ecc4e5..82533f913 100644 --- a/pkg/surveyext/editor.go +++ b/pkg/surveyext/editor.go @@ -46,10 +46,10 @@ var EditorQuestionTemplate = ` {{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color "reset"}} {{- color "default+hb"}}{{ .Message }} {{color "reset"}} {{- if .ShowAnswer}} - {{- color "cyan"}}{{.Answer}}{{color "reset"}}{{"\n"}} + {{- color "cyan"}}{{.Answer}}{{color "reset"}}{{"\n"}} {{- else }} - {{- if and .Help (not .ShowHelp)}}{{color "cyan"}}[{{ .Config.HelpInput }} for help]{{color "reset"}} {{end}} - {{- if and .Default (not .HideDefault)}}{{color "white"}}({{.Default}}) {{color "reset"}}{{end}} + {{- if and .Help (not .ShowHelp)}}{{color "cyan"}}[{{ .Config.HelpInput }} for help]{{color "reset"}} {{end}} + {{- if and .Default (not .HideDefault)}}{{color "white"}}({{.Default}}) {{color "reset"}}{{end}} {{- color "cyan"}}[(e) to launch {{ .EditorCommand }}{{- if .BlankAllowed }}, enter to skip{{ end }}] {{color "reset"}} {{- end}}`