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

fix(1315): update golangci-lint version for memory usage #1316

Merged
merged 4 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ run:
- pkg/k8s/
- tools/generator

# all available settings of specific linters
linters-settings:
misspell:
ignore-words:
- noteable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notable?

Copy link
Member Author

@supereagle supereagle Oct 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a miss spelling error of MergeCommentEvent struct in pkg/server/biz/scm/gitlab/gitlab.go#L311-L350, this struct is copied from Gitlab. It can not be fixed by us, so we have to ignore this error.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field maybe is useless for us, could we delete it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have deleted


linters:
enable:
- golint
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ go_import_path: github.com/caicloud/cyclone
before_install:
- go get github.com/mattn/goveralls
- go get github.com/go-playground/overalls
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.20.1

install:
- go build -o cyclone-server github.com/caicloud/cyclone/cmd/server
Expand All @@ -25,7 +25,7 @@ install:

script:
- overalls -project=github.com/caicloud/cyclone -covermode=count -debug -ignore=Godeps,vendor,tests,.git,scripts,node_modules,docs,tools,build,hack,manifests,release,web,pkg/k8s,pkg/apis
- GOGC=5 golangci-lint run
- golangci-lint run

after_success:
- $HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=overalls.coverprofile
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ lint: $(GOLANGCI_LINT)
build: build-local

$(GOLANGCI_LINT):
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR) v1.16.0
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR) v1.20.1

test:
@go test $$(go list ./... | grep -v /vendor | grep -v /test) -coverprofile=coverage.out
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/biz/integration/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func ToSecret(tenant string, in *api.Integration) (*core_v1.Secret, error) {
if in.Spec.Type == api.Cluster && in.Spec.Cluster != nil {
if in.Spec.Cluster.IsWorkerCluster {
objectMeta.Labels = meta.AddSchedulableClusterLabel(objectMeta.Labels)
} else if _, ok := objectMeta.Labels[meta.LabelIntegrationSchedulableCluster]; ok {
} else {
delete(objectMeta.Labels, meta.LabelIntegrationSchedulableCluster)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/cerr/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var (

// ErrorCreateIntegrationFailed defines error that failed to create integration.
ErrorCreateIntegrationFailed = nerror.InternalServerError.Build(ReasonCreateIntegrationFailed,
"create integration ${name} failed: ${error}, please check your auth infomation")
"create integration ${name} failed: ${error}, please check your auth information")

// ErrorCreateWebhookPermissionDenied defines error that failed creating webhook as permission denied.
ErrorCreateWebhookPermissionDenied = nerror.InternalServerError.Build(ReasonCreateWebhookPermissionDenied,
Expand Down