style: fix lint findings from the review fixes

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 17:43:58 +02:00
1 parent d0cdfe7113
commit 20b9b1a2c1
3 files changed
+8 -5

No files matched your search

+6 -3
View File
@@ -134,11 +134,14 @@ func TestCheckoutNamesTheBranchAfterTheHead(t *testing.T) {
{"deleted head", services.Pull{Number: 7, Head: "feature", HeadRemoteDeleted: true}, nil, "pr/7"}, {"deleted head", services.Pull{Number: 7, Head: "feature", HeadRemoteDeleted: true}, nil, "pr/7"},
{"fork branch at the head without upstream", fork, map[string]string{"rev-parse --verify refs/heads/feature^{commit}": "abc123"}, "feature"}, {"fork branch at the head without upstream", fork, map[string]string{"rev-parse --verify refs/heads/feature^{commit}": "abc123"}, "feature"},
{"fork default branch tracking origin", services.Pull{Number: 7, Head: "main", HeadSHA: "abc123", HeadRepo: "bob/project"}, map[string]string{ {"fork default branch tracking origin", services.Pull{Number: 7, Head: "main", HeadSHA: "abc123", HeadRepo: "bob/project"}, map[string]string{
"rev-parse --verify refs/heads/main^{commit}": "abc123", "config --get branch.main.remote": "origin"}, "bob/main"}, "rev-parse --verify refs/heads/main^{commit}": "abc123", "config --get branch.main.remote": "origin",
}, "bob/main"},
{"branch above the head name", services.Pull{Number: 7, Head: "feature/login", HeadSHA: "abc123", HeadRepo: "alice/project"}, map[string]string{ {"branch above the head name", services.Pull{Number: 7, Head: "feature/login", HeadSHA: "abc123", HeadRepo: "alice/project"}, map[string]string{
"rev-parse --verify refs/heads/feature^{commit}": "other"}, "pr/7"}, "rev-parse --verify refs/heads/feature^{commit}": "other",
}, "pr/7"},
{"branches below the head name", same, map[string]string{ {"branches below the head name", same, map[string]string{
"for-each-ref --count=1 --format=%(refname) refs/heads/feature/": "refs/heads/feature/login"}, "pr/7"}, "for-each-ref --count=1 --format=%(refname) refs/heads/feature/": "refs/heads/feature/login",
}, "pr/7"},
} { } {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
deps, _, _ := testDeps(t) deps, _, _ := testDeps(t)
+1 -1
View File
@@ -333,7 +333,7 @@ func TestBodyEditorTypesInlineWithoutAnEditor(t *testing.T) {
require.Equal(t, []string{terminal.BodyTitle + " ## Steps"}, prompt.texts) require.Equal(t, []string{terminal.BodyTitle + " ## Steps"}, prompt.texts)
// The typed body is kept like an editor draft: reported when the command fails, removed when it succeeds. // The typed body is kept like an editor draft: reported when the command fails, removed when it succeeds.
requireDraft(t, draft.Path, true) requireDraft(t, draft.Path, true)
var failed error = errors.New("create failed") failed := errors.New("create failed")
finishDraft(&draft, &failed) finishDraft(&draft, &failed)
require.ErrorContains(t, failed, "draft saved at "+draft.Path) require.ErrorContains(t, failed, "draft saved at "+draft.Path)
requireDraft(t, draft.Path, true) requireDraft(t, draft.Path, true)
+1 -1
View File
@@ -199,7 +199,7 @@ func (p *FormPrompter) collectIssueProperties(ctx context.Context, title, body s
if err := p.runForm(ctx, huh.NewForm(content)); err != nil { if err := p.runForm(ctx, huh.NewForm(content)); err != nil {
return IssueFormValues{}, err return IssueFormValues{}, err
} }
// The body comes before "What's next?", so cancelling still reports the draft. // The body comes before "What's next?", so canceling still reports the draft.
if values.Body, values.Draft, err = editBody(ctx, choices.EditBody, fields.body); err != nil { if values.Body, values.Draft, err = editBody(ctx, choices.EditBody, fields.body); err != nil {
return values, err return values, err
} }