From 47c57ef6c1419e2665ae24f8b0c345ec036e7085 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 18 Oct 2024 14:26:34 +0300 Subject: [PATCH] docs: put a space between `//` and comment text --- .golangci.yml | 5 +++++ example/newfilewithappauth/main.go | 6 +++--- github/event_types.go | 3 +-- github/event_types_test.go | 4 ++-- github/github_test.go | 4 ++-- scrape/apps.go | 2 +- test/fields/fields.go | 1 - 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 43103588334..252c7c40201 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,6 +6,7 @@ linters: enable: - dogsled - dupl + - gocritic - godot - gofmt - goimports @@ -20,6 +21,10 @@ linters: - unparam - whitespace linters-settings: + gocritic: + disable-all: true + enabled-checks: + - commentFormatting gosec: excludes: # duplicates errcheck diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 7ff5d5b37c3..fd4f4d76ff0 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -33,7 +33,7 @@ func main() { } itr.BaseURL = gitHost - //create git client with app transport + // create git client with app transport client, err := github.NewClient( &http.Client{ Transport: itr, @@ -50,8 +50,8 @@ func main() { log.Fatalf("failed to list installations: %v\n", err) } - //capture our installationId for our app - //we need this for the access token + // capture our installationId for our app + // we need this for the access token var installID int64 for _, val := range installations { installID = val.GetID() diff --git a/github/event_types.go b/github/event_types.go index 64726d77395..f9778215092 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -753,8 +753,7 @@ type MemberChanges struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member type MemberEvent struct { - // Action is the action that was performed. Possible values are: - //"added", "edited", "removed". + // Action is the action that was performed. Possible values are: "added", "edited", "removed". Action *string `json:"action,omitempty"` Member *User `json:"member,omitempty"` Changes *MemberChanges `json:"changes,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index 71c8ac3df2e..0c4deab4177 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -9881,7 +9881,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { }, Rules: &RepositoryRulesetEditedRules{ Added: []*RepositoryRulesetRule{ - //Creating just one object with all the possible rules for testing + // Creating just one object with all the possible rules for testing { Creation: &RepositoryRulesetRuleType{ Type: "creation", @@ -10035,7 +10035,7 @@ func TestRepositoryRulesetEvent_Marshal(t *testing.T) { }, }, Deleted: []*RepositoryRulesetRule{ - //Creating just one object with all the possible rules for testing + // Creating just one object with all the possible rules for testing { Creation: &RepositoryRulesetRuleType{ Type: "creation", diff --git a/github/github_test.go b/github/github_test.go index d4a06f9f2f5..e16a2e47aca 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -2365,14 +2365,14 @@ func TestErrorResponse_Error(t *testing.T) { t.Errorf("Expected non-empty ErrorResponse.Error()") } - //dont panic if request is nil + // dont panic if request is nil res = &http.Response{} err = ErrorResponse{Message: "m", Response: res} if err.Error() == "" { t.Errorf("Expected non-empty ErrorResponse.Error()") } - //dont panic if response is nil + // dont panic if response is nil err = ErrorResponse{Message: "m"} if err.Error() == "" { t.Errorf("Expected non-empty ErrorResponse.Error()") diff --git a/scrape/apps.go b/scrape/apps.go index 307d8e5a65c..db68b583e1a 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -115,7 +115,7 @@ type OAuthApp struct { type AppManifest struct { // The name of the GitHub App. Name *string `json:"name,omitempty"` - //Required. The homepage of your GitHub App. + // Required. The homepage of your GitHub App. URL *string `json:"url,omitempty"` // The full URL(s) of the endpoint(s) to authenticate users via the GitHub App (Max: 10). CallbackURLs []string `json:"callback_urls,omitempty"` diff --git a/test/fields/fields.go b/test/fields/fields.go index 7979ccc838f..0ea783d8c0c 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -49,7 +49,6 @@ func main() { url string typ interface{} }{ - //{"rate_limit", &github.RateLimits{}}, {"users/octocat", &github.User{}}, {"user", &github.User{}}, {"users/willnorris/keys", &[]github.Key{}},