refactor(issue,pr): trim help, restating comments and single-use helpers

Cut issue, pr, label, milestone and comment examples to at most three, drop
doc comments that only restate the name, fold the comment and attachment
argument lookups into one closure each, and inline label helpers with one
caller.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 20:48:00 +02:00
1 parent 4a85bb3d40
commit 2826726557
13 files changed
+57 -147

No files matched your search

+5 -5
View File
@@ -220,8 +220,7 @@ $ tea pr create
# Take the title and body from the commits, without questions
$ tea pr create --fill
$ tea pr create -t "Add login" -b "Closes #1" -B develop -r carol -l enhancement
$ tea pr create --draft --fill`
$ tea pr create -t "Add login" -b "Closes #1" -B develop -r carol -l enhancement`
return create
}
@@ -316,13 +315,14 @@ func (a *application) createPullInteractively(cmd *cobra.Command, snapshot setti
if err != nil {
return err
}
selectables, err := (services.Pulls{Client: target.client, Repository: target.Repo}).CreateSelectables(cmd.Context())
service := services.Pulls{Client: target.client, Repository: target.Repo}
selectables, err := service.CreateSelectables(cmd.Context())
if err != nil {
return err
}
baseOwner, _, _ := strings.Cut(target.Repo, "/")
headOwner, headBranch := a.defaultPullHead(cmd.Context())
template, err := (services.Pulls{Client: target.client, Repository: target.Repo}).Template(cmd.Context(), repo.DefaultBranch)
template, err := service.Template(cmd.Context(), repo.DefaultBranch)
if err != nil {
return err
}
@@ -361,7 +361,7 @@ func (a *application) createPullInteractively(cmd *cobra.Command, snapshot setti
if err := a.ensureHeadPublished(cmd, target, snapshot, options.Head); err != nil {
return err
}
item, err := (services.Pulls{Client: target.client, Repository: target.Repo}).Create(cmd.Context(), options)
item, err := service.Create(cmd.Context(), options)
if err != nil {
return err
}