Loading .golangci.yml +6 −0 Original line number Diff line number Diff line Loading @@ -51,11 +51,17 @@ linters: revive: enable-all-rules: false rules: - name: comment-spacings - name: deep-exit - name: error-strings - name: get-return - name: identical-switch-branches - name: increment-decrement - name: indent-error-flow - name: redundant-import-alias - name: struct-tag - name: time-date - name: unnecessary-stmt - name: unused-parameter - name: use-errors-new - name: var-naming Loading config/config.go +1 −2 Original line number Diff line number Diff line Loading @@ -1069,8 +1069,7 @@ func (c *Config) defaulting() { continue } switch p := auth.AuthInfo.AuthProvider.(type) { case *v1beta1.AuthInfo_Oauth2: if p, ok := auth.AuthInfo.AuthProvider.(*v1beta1.AuthInfo_Oauth2); ok { if p.Oauth2.Oauth2AccessToken == nil { p.Oauth2.Oauth2AccessToken = &v1beta1.OAuth2_AccessToken{} } Loading gitlab.go +1 −2 Original line number Diff line number Diff line Loading @@ -1287,9 +1287,8 @@ func (e *ErrorResponse) Error() string { if e.Message == "" { return fmt.Sprintf("%s %s: %d", e.Response.Request.Method, url, e.Response.StatusCode) } else { return fmt.Sprintf("%s %s: %d %s", e.Response.Request.Method, url, e.Response.StatusCode, e.Message) } return fmt.Sprintf("%s %s: %d %s", e.Response.Request.Method, url, e.Response.StatusCode, e.Message) } func (e *ErrorResponse) HasStatusCode(statusCode int) bool { Loading request_options_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ func TestWithContextAndWithRequestRetry(t *testing.T) { retryCount := 0 mux, client := setup(t) mux.HandleFunc("/api/v4/success-on-3rd", func(w http.ResponseWriter, r *http.Request) { retryCount += 1 retryCount++ if retryCount < 3 { w.WriteHeader(http.StatusMethodNotAllowed) Loading Loading @@ -310,7 +310,7 @@ func TestWithRequestRetry(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/success-on-3rd", func(w http.ResponseWriter, r *http.Request) { retryCount += 1 retryCount++ switch retryCount { case 1: w.WriteHeader(http.StatusMethodNotAllowed) Loading types.go +2 −8 Original line number Diff line number Diff line Loading @@ -877,16 +877,10 @@ type BoolValue bool // https://github.com/gitlabhq/terraform-provider-gitlab/issues/348 func (t *BoolValue) UnmarshalJSON(b []byte) error { switch string(b) { case `"1"`: case `"1"`, `"true"`: *t = true return nil case `"0"`: *t = false return nil case `"true"`: *t = true return nil case `"false"`: case `"0"`, `"false"`: *t = false return nil default: Loading graphql.go +1 −1 File changed.Contains only whitespace changes. Show changes Loading
.golangci.yml +6 −0 Original line number Diff line number Diff line Loading @@ -51,11 +51,17 @@ linters: revive: enable-all-rules: false rules: - name: comment-spacings - name: deep-exit - name: error-strings - name: get-return - name: identical-switch-branches - name: increment-decrement - name: indent-error-flow - name: redundant-import-alias - name: struct-tag - name: time-date - name: unnecessary-stmt - name: unused-parameter - name: use-errors-new - name: var-naming Loading
config/config.go +1 −2 Original line number Diff line number Diff line Loading @@ -1069,8 +1069,7 @@ func (c *Config) defaulting() { continue } switch p := auth.AuthInfo.AuthProvider.(type) { case *v1beta1.AuthInfo_Oauth2: if p, ok := auth.AuthInfo.AuthProvider.(*v1beta1.AuthInfo_Oauth2); ok { if p.Oauth2.Oauth2AccessToken == nil { p.Oauth2.Oauth2AccessToken = &v1beta1.OAuth2_AccessToken{} } Loading
gitlab.go +1 −2 Original line number Diff line number Diff line Loading @@ -1287,9 +1287,8 @@ func (e *ErrorResponse) Error() string { if e.Message == "" { return fmt.Sprintf("%s %s: %d", e.Response.Request.Method, url, e.Response.StatusCode) } else { return fmt.Sprintf("%s %s: %d %s", e.Response.Request.Method, url, e.Response.StatusCode, e.Message) } return fmt.Sprintf("%s %s: %d %s", e.Response.Request.Method, url, e.Response.StatusCode, e.Message) } func (e *ErrorResponse) HasStatusCode(statusCode int) bool { Loading
request_options_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ func TestWithContextAndWithRequestRetry(t *testing.T) { retryCount := 0 mux, client := setup(t) mux.HandleFunc("/api/v4/success-on-3rd", func(w http.ResponseWriter, r *http.Request) { retryCount += 1 retryCount++ if retryCount < 3 { w.WriteHeader(http.StatusMethodNotAllowed) Loading Loading @@ -310,7 +310,7 @@ func TestWithRequestRetry(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/success-on-3rd", func(w http.ResponseWriter, r *http.Request) { retryCount += 1 retryCount++ switch retryCount { case 1: w.WriteHeader(http.StatusMethodNotAllowed) Loading
types.go +2 −8 Original line number Diff line number Diff line Loading @@ -877,16 +877,10 @@ type BoolValue bool // https://github.com/gitlabhq/terraform-provider-gitlab/issues/348 func (t *BoolValue) UnmarshalJSON(b []byte) error { switch string(b) { case `"1"`: case `"1"`, `"true"`: *t = true return nil case `"0"`: *t = false return nil case `"true"`: *t = true return nil case `"false"`: case `"0"`, `"false"`: *t = false return nil default: Loading