Skip to content

Commit b54af88

Browse files
authored
Replace lint-go-gopls with additional govet linters (#36028)
Many (but not all) analyzers ran by `gopls check` are available in `golangci-lint` as part of default-disabled `govet` linters, so I think it's best we remove this manual linting step and let `golangci-lint` handle it. I hand-picked two available linters that were previously linted using gopls and this list is not exhaustive. This will reduce CI time by about 3 minutes.
1 parent f4e38e6 commit b54af88

File tree

3 files changed

+5
-31
lines changed

3 files changed

+5
-31
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ linters:
114114
- stringsbuilder
115115
perfsprint:
116116
concat-loop: false
117+
govet:
118+
enable:
119+
- nilness
120+
- unusedwrite
117121
exclusions:
118122
generated: lax
119123
presets:

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
4040
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
4141
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1
4242
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/[email protected]
43-
GOPLS_PACKAGE ?= golang.org/x/tools/[email protected]
4443

4544
DOCKER_IMAGE ?= gitea/gitea
4645
DOCKER_TAG ?= latest
@@ -333,7 +332,7 @@ lint-frontend: lint-js lint-css ## lint frontend files
333332
lint-frontend-fix: lint-js-fix lint-css-fix ## lint frontend files and fix issues
334333

335334
.PHONY: lint-backend
336-
lint-backend: lint-go lint-go-gitea-vet lint-go-gopls lint-editorconfig ## lint backend files
335+
lint-backend: lint-go lint-go-gitea-vet lint-editorconfig ## lint backend files
337336

338337
.PHONY: lint-backend-fix
339338
lint-backend-fix: lint-go-fix lint-go-gitea-vet lint-editorconfig ## lint backend files and fix issues
@@ -396,11 +395,6 @@ lint-go-gitea-vet: ## lint go files with gitea-vet
396395
@echo "Running gitea-vet..."
397396
@$(GO) vet -vettool="$(shell GOOS= GOARCH= go tool -n gitea-vet)" ./...
398397

399-
.PHONY: lint-go-gopls
400-
lint-go-gopls: ## lint go files with gopls
401-
@echo "Running gopls check..."
402-
@GO=$(GO) GOPLS_PACKAGE=$(GOPLS_PACKAGE) tools/lint-go-gopls.sh $(GO_SOURCES)
403-
404398
.PHONY: lint-editorconfig
405399
lint-editorconfig:
406400
@echo "Running editorconfig check..."
@@ -844,7 +838,6 @@ deps-tools: ## install tool dependencies
844838
$(GO) install $(GO_LICENSES_PACKAGE) & \
845839
$(GO) install $(GOVULNCHECK_PACKAGE) & \
846840
$(GO) install $(ACTIONLINT_PACKAGE) & \
847-
$(GO) install $(GOPLS_PACKAGE) & \
848841
wait
849842

850843
node_modules: pnpm-lock.yaml

tools/lint-go-gopls.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)