diff --git a/src/.golangci.yaml b/src/.golangci.yaml index 6ba130de6..378712680 100644 --- a/src/.golangci.yaml +++ b/src/.golangci.yaml @@ -7,6 +7,10 @@ linters-settings: locale: US,UK goimports: local-prefixes: github.com/goharbor/harbor + stylecheck: + checks: [ + "ST1019", # Importing the same package multiple times. + ] linters: disable-all: true @@ -40,7 +44,7 @@ linters: # - rowserrcheck # - staticcheck - structcheck - # - stylecheck + - stylecheck # - unconvert # - unparam - unused diff --git a/src/controller/event/handler/webhook/artifact/artifact.go b/src/controller/event/handler/webhook/artifact/artifact.go index 9c0af8142..24a3ea753 100644 --- a/src/controller/event/handler/webhook/artifact/artifact.go +++ b/src/controller/event/handler/webhook/artifact/artifact.go @@ -27,7 +27,6 @@ import ( "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/pkg" "github.com/goharbor/harbor/src/pkg/notification" - "github.com/goharbor/harbor/src/pkg/notifier/model" notifyModel "github.com/goharbor/harbor/src/pkg/notifier/model" proModels "github.com/goharbor/harbor/src/pkg/project/models" ) @@ -91,7 +90,7 @@ func (a *Handler) handle(ctx context.Context, event *event.ArtifactEvent) error return nil } -func (a *Handler) constructArtifactPayload(event *event.ArtifactEvent, project *proModels.Project) (*model.Payload, error) { +func (a *Handler) constructArtifactPayload(event *event.ArtifactEvent, project *proModels.Project) (*notifyModel.Payload, error) { repoName := event.Repository if repoName == "" { return nil, fmt.Errorf("invalid %s event with empty repo name", event.EventType) diff --git a/src/controller/event/handler/webhook/quota/quota.go b/src/controller/event/handler/webhook/quota/quota.go index 62797b6db..8c5d2d9ef 100644 --- a/src/controller/event/handler/webhook/quota/quota.go +++ b/src/controller/event/handler/webhook/quota/quota.go @@ -25,7 +25,6 @@ import ( "github.com/goharbor/harbor/src/lib/log" "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/pkg/notification" - "github.com/goharbor/harbor/src/pkg/notifier/model" notifyModel "github.com/goharbor/harbor/src/pkg/notifier/model" proModels "github.com/goharbor/harbor/src/pkg/project/models" ) @@ -82,7 +81,7 @@ func (qp *Handler) IsStateful() bool { return false } -func constructQuotaPayload(event *event.QuotaEvent) (*model.Payload, error) { +func constructQuotaPayload(event *event.QuotaEvent) (*notifyModel.Payload, error) { repoName := event.RepoName if repoName == "" { return nil, fmt.Errorf("invalid %s event with empty repo name", event.EventType)