diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-05-28 02:57:33 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-05-28 04:11:34 +0300 |
commit | fcc4821ce03aa2f1c44c9a4b705f691e648de0d4 (patch) | |
tree | eab631a5ff0dd9332ff2e03afe5f93d4e68d8225 /Makefile.util.mk | |
parent | 08d8a8c4b27ec66485dbc4cbcb0d9088ba52720b (diff) |
Use custom code_quality job inspired by the runner
Diffstat (limited to 'Makefile.util.mk')
-rw-r--r-- | Makefile.util.mk | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile.util.mk b/Makefile.util.mk index c49b58bb..3f483647 100644 --- a/Makefile.util.mk +++ b/Makefile.util.mk @@ -1,14 +1,17 @@ # Dockerfile https://gitlab.com/gitlab-org/gitlab-build-images/-/blob/master/Dockerfile.golangci-lint-alpine -GOLANGCI_LINT_IMAGE := registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine +GOLANGCI_LINT_IMAGE := golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) -.PHONY: lint test race acceptance bench cover list deps-check deps-download +.PHONY: lint lint-docker test race acceptance bench cover list deps-check deps-download + +OUT_FORMAT ?= colored-line-number +LINT_FLAGS ?= $(if $V,-v) lint: .GOPATH/.ok bin/golangci-lint - $Q ./bin/golangci-lint run $(if $V,-v) + $Q ./bin/golangci-lint run ./... --out-format $(OUT_FORMAT) $(LINT_FLAGS) lint-docker: docker run -v $(PWD):/app -w /app $(GOLANGCI_LINT_IMAGE) \ - sh -c "golangci-lint run --out-format code-climate | tee gl-code-quality-report.json | jq -r '.[] | \"\(.location.path):\(.location.lines.begin) \(.description)\"'" + sh -c "golangci-lint run ./... --out-format $(OUT_FORMAT) $(LINT_FLAGS)" test: .GOPATH/.ok gitlab-pages go test $(if $V,-v) $(allpackages) |