Skip to content

style: clean up linter complaints #1001

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

Merged
merged 3 commits into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/bug/bug_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func newBugCommentCommand(env *execenv.Env) *cobra.Command {
}

func runBugComment(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_comment_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func newBugCommentNewCommand(env *execenv.Env) *cobra.Command {
}

func runBugCommentNew(env *execenv.Env, opts bugCommentNewOptions, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion commands/bug/bug_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func requireCommentsEqual(t *testing.T, golden string, env *execenv.Env) {
comments = normalizeParsedComments(t, comments)

if *cmdtest.Update {
t.Log("Got here")
for i, comment := range comments {
fileName := fmt.Sprintf(goldenFilePattern, golden, i)
require.NoError(t, os.WriteFile(fileName, []byte(comment.message), 0644))
Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func newBugLabelCommand(env *execenv.Env) *cobra.Command {
}

func runBugLabel(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions commands/bug/bug_label_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ func newBugLabelNewCommand(env *execenv.Env) *cobra.Command {
}

func runBugLabelNew(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, cleanArgs, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}

added := args
added := cleanArgs

changes, _, err := b.ChangeLabels(text.CleanupOneLineArray(added), nil)

Expand Down
4 changes: 2 additions & 2 deletions commands/bug/bug_label_rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ func newBugLabelRmCommand(env *execenv.Env) *cobra.Command {
}

func runBugLabelRm(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, cleanArgs, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}

removed := args
removed := cleanArgs

changes, _, err := b.ChangeLabels(nil, text.CleanupOneLineArray(removed))

Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The complementary command is "git bug deselect" performing the opposite operatio

func runBugSelect(env *execenv.Env, args []string) error {
if len(args) == 0 {
return errors.New("You must provide a bug id")
return errors.New("a bug id must be provided")
}

prefix := args[0]
Expand Down
4 changes: 2 additions & 2 deletions commands/bug/bug_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func newBugShowCommand(env *execenv.Env) *cobra.Command {
}

func runBugShow(env *execenv.Env, opts bugShowOptions, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down Expand Up @@ -91,7 +91,7 @@ func runBugShow(env *execenv.Env, opts bugShowOptions, args []string) error {
case "title":
env.Out.Printf("%s\n", snap.Title)
default:
return fmt.Errorf("\nUnsupported field: %s\n", opts.fields)
return fmt.Errorf("unsupported field: %s", opts.fields)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func newBugStatusCommand(env *execenv.Env) *cobra.Command {
}

func runBugStatus(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_status_close.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func newBugStatusCloseCommand(env *execenv.Env) *cobra.Command {
}

func runBugStatusClose(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_status_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func newBugStatusOpenCommand(env *execenv.Env) *cobra.Command {
}

func runBugStatusOpen(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_title.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func newBugTitleCommand(env *execenv.Env) *cobra.Command {
}

func runBugTitle(env *execenv.Env, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion commands/bug/bug_title_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func newBugTitleEditCommand(env *execenv.Env) *cobra.Command {
}

func runBugTitleEdit(env *execenv.Env, opts bugTitleEditOptions, args []string) error {
b, args, err := ResolveSelected(env.Backend, args)
b, _, err := ResolveSelected(env.Backend, args)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions commands/bug/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func BugAndLabelsCompletion(env *execenv.Env, addOrRemove bool) completion.Valid
_ = env.Backend.Close()
}()

b, args, err := ResolveSelected(env.Backend, args)
b, cleanArgs, err := ResolveSelected(env.Backend, args)
if _select.IsErrNoValidId(err) {
// we need a bug first to complete labels
return bugWithBackend(env.Backend, toComplete)
Expand All @@ -62,7 +62,7 @@ func BugAndLabelsCompletion(env *execenv.Env, addOrRemove bool) completion.Valid
snap := b.Snapshot()

seenLabels := map[bug.Label]bool{}
for _, label := range args {
for _, label := range cleanArgs {
seenLabels[bug.Label(label)] = addOrRemove
}

Expand Down