diff --git a/.circleci/coverage-targets b/.circleci/coverage-targets deleted file mode 100644 index b49d640e..00000000 --- a/.circleci/coverage-targets +++ /dev/null @@ -1,2 +0,0 @@ -coverage -coverage/gojay diff --git a/.circleci/lint-buildtags b/.circleci/lint-buildtags deleted file mode 100644 index 51ed058e..00000000 --- a/.circleci/lint-buildtags +++ /dev/null @@ -1,2 +0,0 @@ - ---build-tags=gojay diff --git a/.golangci.yml b/.golangci.yml index 7d0ebfc2..8667ed4c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -240,11 +240,3 @@ issues: - path: "(client|server)_json.go" linters: - nlreturn - - path: _gojay\.go - linters: - - cyclop - - gocyclo - - nlreturn - - path: keys_gojay.go - linters: - - gosec diff --git a/Makefile b/Makefile index c20330e5..f08992fc 100644 --- a/Makefile +++ b/Makefile @@ -54,58 +54,29 @@ test: tools/bin/gotestsum ## Runs package test including race condition. $(call target) @CGO_ENABLED=${CGO_ENABLED} ${GO_TEST} ${GO_TEST_FLAGS} -run=${GO_TEST_FUNC} -tags='$(subst $(space),$(comma),${GO_BUILDTAGS})' ${GO_TEST_PKGS} -.PHONY: test/gojay -test/gojay: GO_BUILDTAGS+=gojay -test/gojay: TARGET=test/gojay -test/gojay: test - -.PHONY: bench -bench: GO_TEST=go test -bench: ## Take a package benchmark. - $(call target) - @CGO_ENABLED=${CGO_ENABLED} ${GO_TEST} -run='^$$' -bench=${GO_BENCH_FUNC} ${GO_BENCH_FLAGS} $(strip ${GO_FLAGS}) ${GO_TEST_PKGS} - .PHONY: coverage coverage: CGO_ENABLED=1 coverage: tools/bin/gotestsum ## Takes packages test coverage. $(call target) CGO_ENABLED=${CGO_ENABLED} ${GO_TEST} ${GO_TEST_FLAGS} -covermode=atomic -coverpkg=./... -coverprofile=coverage.out $(strip ${GO_FLAGS}) ${GO_PKGS} -.PHONY: coverage/gojay -coverage/gojay: GO_BUILDTAGS+=gojay -coverage/gojay: coverage - ##@ fmt, lint .PHONY: lint lint: fmt lint/golangci-lint ## Run all linters. -.PHONY: lint -lint/gojay: fmt/gojay lint/golangci-lint/gojay - .PHONY: fmt fmt: tools/goimportz tools/gofumpt ## Run goimportz and gofumpt. $(call target) find . -iname "*.go" -not -path "./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN}/goimportz -local=${PKG},$(subst /protocol,,$(PKG)) -w find . -iname "*.go" -not -path "./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN}/gofumpt -extra -w -.PHONY: fmt/gojay -fmt/gojay: tools/goimportz tools/gofumpt - $(call target) - @export GOFLAGS=-tags=gojay - find . -iname "*.go" -not -path "./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN}/goimportz -local=${PKG},$(subst /protocol,,$(PKG)) -w - find . -iname "*.go" -not -path "./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN}/gofumpt -extra -w - .PHONY: lint/golangci-lint lint/golangci-lint: tools/golangci-lint .golangci.yml ## Run golangci-lint. $(call target) ${TOOLS_BIN}/golangci-lint -j ${JOBS} run $(strip ${GO_LINT_FLAGS}) ./... -.PHONY: lint/golangci-lint/gojay -lint/golangci-lint/gojay: GO_LINT_FLAGS+=--build-tags=gojay -lint/golangci-lint/gojay: lint/golangci-lint - ##@ tools