Skip to content

Commit 330f245

Browse files
committed
ci/circleci: support gojay build tags linting
1 parent c09dc1a commit 330f245

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ jobs:
3535

3636
lint:
3737
<<: *defaults
38+
parallelism: 2
3839
steps:
3940
- checkout
4041
- golang/gomod
4142
- run:
4243
name: Run lint for sources
4344
command: |
44-
make lint
45+
make lint GO_LINT_FLAGS=$(circleci tests split .circleci/lint-buildtags)
4546
4647
workflows:
4748
version: 2

.circleci/lint-buildtags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
--build-tags=gojay

hack/make/go.mk

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ GO_TEST_FUNC ?= .
2222
GO_TEST_FLAGS ?=
2323
GO_BENCH_FUNC ?= .
2424
GO_BENCH_FLAGS ?= -benchmem
25+
GO_LINT_FLAGS ?=
2526

2627
CGO_ENABLED ?= 1
2728
GO_LDFLAGS=-s -w
@@ -111,18 +112,7 @@ coverage/ci: ## Takes packages test coverage, and output coverage results to CI
111112
## lint
112113

113114
.PHONY: lint
114-
lint: lint/vet lint/golangci-lint ## Run all linters.
115-
116-
$(GO_PATH)/bin/vet:
117-
@GO111MODULE=off go get -u golang.org/x/tools/go/analysis/cmd/vet golang.org/x/tools/go/analysis/passes/...
118-
119-
.PHONY: cmd/vet
120-
cmd/vet: $(GO_PATH)/bin/vet # go get 'vet' binary
121-
122-
.PHONY: lint/vet
123-
lint/vet: cmd/vet
124-
$(call target)
125-
@GO111MODULE=on vet -asmdecl -assign -atomic -atomicalign -bools -buildtag -cgocall -compositewhitelist -copylocks -errorsas -httpresponse -loopclosure -lostcancel -methods -nilfunc -printfuncs -rangeloops -shift -source -stdmethods -structtag -tests -unmarshal -unreachable -unsafeptr $(GO_PKGS)
115+
lint: lint/golangci-lint ## Run all linters.
126116

127117
$(GO_PATH)/bin/golangci-lint:
128118
@GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
@@ -133,7 +123,7 @@ cmd/golangci-lint: $(GO_PATH)/bin/golangci-lint # go get 'golangci-lint' binary
133123
.PHONY: lint/golangci-lint
134124
lint/golangci-lint: cmd/golangci-lint .golangci.yml ## Run golangci-lint.
135125
$(call target)
136-
@GO111MODULE=on golangci-lint run ./...
126+
@GO111MODULE=on golangci-lint run $(strip ${GO_LINT_FLAGS}) ./...
137127

138128

139129
## mod

0 commit comments

Comments
 (0)