Skip to content

Commit 43c8d85

Browse files
authored
Disable vet as part of go test (#33662)
`go vet` implicitely runs as part of `go test`, but we already have `make lint-go-vet`, so we were essentially running it twice. This should hopefully make `go test` slightly faster. Ref: https://pkg.go.dev/cmd/go#hdr-Test_packages > As part of building a test binary, go test runs go vet
1 parent 216243e commit 43c8d85

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/pull-compliance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
go-version-file: go.mod
9696
check-latest: true
9797
- run: make deps-backend deps-tools
98-
- run: make lint-go-windows lint-go-vet
98+
- run: make lint-go-windows lint-go-gitea-vet
9999
env:
100100
TAGS: bindata sqlite sqlite_unlock_notify
101101
GOOS: windows

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ EXTRA_GOFLAGS ?=
7373
MAKE_VERSION := $(shell "$(MAKE)" -v | cat | head -n 1)
7474
MAKE_EVIDENCE_DIR := .make_evidence
7575

76+
GOTESTFLAGS ?= -vet=off
7677
ifeq ($(RACE_ENABLED),true)
7778
GOFLAGS += -race
7879
GOTESTFLAGS += -race
@@ -311,10 +312,10 @@ lint-frontend: lint-js lint-css ## lint frontend files
311312
lint-frontend-fix: lint-js-fix lint-css-fix ## lint frontend files and fix issues
312313

313314
.PHONY: lint-backend
314-
lint-backend: lint-go lint-go-vet lint-go-gopls lint-editorconfig ## lint backend files
315+
lint-backend: lint-go lint-go-gitea-vet lint-go-gopls lint-editorconfig ## lint backend files
315316

316317
.PHONY: lint-backend-fix
317-
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig ## lint backend files and fix issues
318+
lint-backend-fix: lint-go-fix lint-go-gitea-vet lint-editorconfig ## lint backend files and fix issues
318319

319320
.PHONY: lint-js
320321
lint-js: node_modules ## lint js files
@@ -365,9 +366,9 @@ lint-go-windows:
365366
@GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
366367
golangci-lint run
367368

368-
.PHONY: lint-go-vet
369-
lint-go-vet: ## lint go files with vet
370-
@echo "Running go vet..."
369+
.PHONY: lint-go-gitea-vet
370+
lint-go-gitea-vet: ## lint go files with gitea-vet
371+
@echo "Running gitea-vet..."
371372
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
372373
@$(GO) vet -vettool=gitea-vet ./...
373374

0 commit comments

Comments
 (0)