Skip to content
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

Remove deprecated linters, add gocyclo and gofumpt #213

Merged
merged 1 commit into from Aug 26, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions .golangci.yml
Expand Up @@ -30,14 +30,17 @@ linters-settings:
- name: unused-parameter
- name: var-declaration
- name: var-naming
gocyclo:
min-complexity: 15

linters:
enable:
- asciicheck
- deadcode
- errcheck
- errorlint
- gocyclo
- gofmt
- gofumpt
- goimports
- gosec
- gosimple
Expand All @@ -50,12 +53,10 @@ linters:
- predeclared
- revive
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
disable-all: true
issues:
Expand Down
4 changes: 2 additions & 2 deletions cmd/gateway/gateway_suite_test.go
@@ -1,10 +1,10 @@
package main_test

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"testing"
)

func TestGateway(t *testing.T) {
Expand Down
12 changes: 7 additions & 5 deletions cmd/gateway/setup.go
Expand Up @@ -14,11 +14,13 @@ const (
errTmpl = "failed validation - flag: '--%s' reason: '%s'\n"
)

type Validator func(*flag.FlagSet) error
type ValidatorContext struct {
Key string
V Validator
}
type (
Validator func(*flag.FlagSet) error
ValidatorContext struct {
Key string
V Validator
}
)

func GatewayControllerParam(domain string, namespace string) ValidatorContext {
name := "gateway-ctlr-name"
Expand Down
4 changes: 2 additions & 2 deletions internal/events/events_suit_test.go
@@ -1,10 +1,10 @@
package events_test

import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"testing"
)

func TestState(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion internal/events/handler.go
Expand Up @@ -62,7 +62,6 @@ func NewEventHandlerImpl(cfg EventHandlerConfig) *EventHandlerImpl {
}

func (h *EventHandlerImpl) HandleEventBatch(ctx context.Context, batch EventBatch) {

for _, event := range batch {
switch e := event.(type) {
case *UpsertEvent:
Expand Down
1 change: 0 additions & 1 deletion internal/events/handler_test.go
Expand Up @@ -121,7 +121,6 @@ var _ = Describe("EventHandler", func() {

// Check that a reconfig happened
expectReconfig(fakeConf, fakeCfg, fakeStatuses)

},
Entry("HTTPRoute upsert", &events.UpsertEvent{Resource: &v1beta1.HTTPRoute{}}),
Entry("Gateway upsert", &events.UpsertEvent{Resource: &v1beta1.Gateway{}}),
Expand Down
1 change: 0 additions & 1 deletion internal/state/secrets_test.go
Expand Up @@ -309,7 +309,6 @@ var _ = Describe("SecretStore", func() {

validToInvalidSecret = secret1.DeepCopy()
validToInvalidSecret.Data[apiv1.TLSCertKey] = invalidCert

})
Describe("handles CRUD events on secrets", Ordered, func() {
testUpsert := func(s *apiv1.Secret, valid bool) {
Expand Down
1 change: 0 additions & 1 deletion internal/state/services_test.go
Expand Up @@ -57,7 +57,6 @@ var _ = Describe("ServiceStore", func() {

Expect(address).To(Equal("10.0.0.2"))
Expect(err).To(BeNil())

})

It("should delete the service", func() {
Expand Down
3 changes: 1 addition & 2 deletions internal/status/clock.go
Expand Up @@ -12,8 +12,7 @@ type Clock interface {
}

// Real clock returns the current local time.
type RealClock struct {
}
type RealClock struct{}

// NewRealClock creates a new RealClock.
func NewRealClock() *RealClock {
Expand Down
4 changes: 2 additions & 2 deletions internal/status/status_suit_test.go
@@ -1,10 +1,10 @@
package status

import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"testing"
)

func TestState(t *testing.T) {
Expand Down