Skip to content

Commit 3b0cf88

Browse files
committed
ref: code formating
1 parent 0ec8f9d commit 3b0cf88

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

cmd/github.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ func createPrReview(c *github.Client, issuesMessage string) (err error) {
4545

4646
return nil
4747
}
48-

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package cmd
22

33
import (
4+
"context"
45
"fmt"
56
"log"
67
"os"
78
"slices"
89
"strings"
9-
"context"
1010

1111
"github.com/go-git/go-git/v5"
1212
"github.com/go-git/go-git/v5/plumbing"
@@ -33,7 +33,7 @@ var (
3333
repository string
3434
commentOnly bool
3535
commentDrafts bool
36-
token string
36+
token string
3737
)
3838

3939
var rootCmd = &cobra.Command{
@@ -56,7 +56,7 @@ var versionCmd = &cobra.Command{
5656
func lint() {
5757
if createReview {
5858
if err := initGHSettings(); err != nil {
59-
log.Fatal(err)
59+
log.Fatal(err)
6060
}
6161
}
6262

cmd/utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package cmd
33
import (
44
"fmt"
55
"os"
6-
"strings"
76
"strconv"
7+
"strings"
88

99
"github.com/go-git/go-git/v5"
1010
"github.com/go-git/go-git/v5/plumbing"
@@ -52,12 +52,12 @@ func getRepository() (string, error) {
5252
repo, exists := os.LookupEnv("GITHUB_REPOSITORY")
5353
if !exists {
5454
return "", errMissingRepository
55-
}
55+
}
5656

5757
return repo, nil
5858
}
5959

60-
func prIsDraft(pr *github.PullRequest) bool {
60+
func prIsDraft(pr *github.PullRequest) bool {
6161
return pr.GetDraft()
6262
}
6363

cmd/utils_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package cmd
22

33
import (
4-
"testing"
5-
"os"
64
"github.com/google/go-github/v72/github"
5+
"os"
6+
"testing"
77
)
88

99
func TestGetGHToken(t *testing.T) {
@@ -30,13 +30,13 @@ func TestGetGHToken(t *testing.T) {
3030
})
3131
}
3232

33-
func TestPRisDraft(t *testing.T) {
33+
func TestPRisDraft(t *testing.T) {
3434
want := true
3535
ghpr := &github.PullRequest{
3636
Draft: &want,
3737
}
3838
got := prIsDraft(ghpr)
39-
if got != want {
39+
if got != want {
4040
t.Fatalf("Expected [ %v ], got [ %v ]", want, got)
4141
}
4242
}
@@ -128,7 +128,6 @@ func TestSplitOwnerRepo(t *testing.T) {
128128
}
129129
}
130130

131-
132131
func TestPullRequest(t *testing.T) {
133132
t.Run("Is pull request", func(t *testing.T) {
134133
_ = os.Setenv("GITHUB_EVENT_TYPE", "pull_request")
@@ -149,7 +148,6 @@ func TestPullRequest(t *testing.T) {
149148
})
150149
}
151150

152-
153151
func TestEmptyLine(t *testing.T) {
154152
testsCases := []struct {
155153
want bool

0 commit comments

Comments
 (0)