From e60c03454fc804e8641a54cdb9d91e202e536a95 Mon Sep 17 00:00:00 2001 From: Brandon Mitchell Date: Fri, 21 Aug 2026 11:00:13 -0400 Subject: [PATCH] Remove golangci-lint This linter is Go version dependent, and results in more maintenance overhead than code fixes. Instead, this switches to "go fmt" and "go vet" for some minimal compiler checks. Signed-off-by: Brandon Mitchell --- .golangci.yml | 32 -------------------------------- HACKING.md | 4 +--- Makefile | 20 +++++--------------- 3 files changed, 6 insertions(+), 50 deletions(-) delete mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index 406764428..000000000 --- a/.golangci.yml +++ /dev/null @@ -1,32 +0,0 @@ -run: - timeout: 10m - -linters: - disable-all: true - enable: - - dupl - - errorlint - - gofmt - - goimports - - gomodguard - - gosimple - - govet - - ineffassign - - misspell - - nakedret - - revive - - unused - - staticcheck - -linters-settings: - gofmt: - simplify: true - gomodguard: - blocked: - modules: - - github.com/pkg/errors: - recommendations: - - errors - - fmt - dupl: - threshold: 400 diff --git a/HACKING.md b/HACKING.md index 785c5d110..63efe0b30 100644 --- a/HACKING.md +++ b/HACKING.md @@ -23,8 +23,7 @@ The following make targets are relevant for any work involving the Go packages. ### Linting -The included Go source code is being examined for any linting violations not included in the standard Go compiler. -Linting is done using [golangci-lint][golangci-lint]. +The included Go source code is being examined for any linting violations by the standard Go compiler. Invocation: @@ -106,6 +105,5 @@ make img/media-types.png ``` [docker]: https://www.docker.com/ -[golangci-lint]: https://github.com/golangci/golangci-lint [graphviz]: https://www.graphviz.org/ [jq]: https://stedolan.github.io/jq/ diff --git a/Makefile b/Makefile index 72cce275d..2caf206f6 100644 --- a/Makefile +++ b/Makefile @@ -85,10 +85,10 @@ check-license: ## check license headers in source files lint: lint-go lint-md ## Run all linters .PHONY: lint-go -lint-go: .install.lint ## lint check of Go files using golangci-lint - @echo "checking Go lint" - @GO111MODULE=on $(GOPATH)/bin/golangci-lint run - @[ "$$BUILD_SPEC_MODULE_ONLY" = true ] || { cd schema && GO111MODULE=on $(GOPATH)/bin/golangci-lint run; } +lint-go: ## run various checks on the Go files + test -z "$$(go fmt ./...)" + go vet ./... + [ "$$BUILD_SPEC_MODULE_ONLY" = true ] || ( cd schema && test -z "$$(go fmt ./...)" && go vet ./... ) .PHONY: lint-md lint-md: ## Run linting for markdown @@ -98,7 +98,7 @@ lint-md: ## Run linting for markdown .PHONY: test test: ## run the unit tests go test -race -cover ./... - [ "$$BUILD_SPEC_MODULE_ONLY" = true ] || { cd schema && go test -race -cover ./...; } + [ "$$BUILD_SPEC_MODULE_ONLY" = true ] || ( cd schema && go test -race -cover ./... ) img/%.png: img/%.dot ## generate PNG from dot file dot -Tpng $^ > $@ @@ -116,16 +116,6 @@ endif .PHONY: .install.tools install.tools: $(TOOLS:%=.install.%) -.PHONY: .install.lint -.install.lint: - case "$$(go env GOVERSION)" in \ - go1.18.*) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.3;; \ - go1.19.*) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.1;; \ - go1.20.*) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2;; \ - go1.21.*) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1;; \ - *) go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest;; \ - esac - .PHONY: .install.gitvalidation .install.gitvalidation: go install github.com/vbatts/git-validation@latest