From 6d59ad3f02bc97c0b5040f59259fa8450702a2e2 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Thu, 16 Mar 2023 21:44:24 +0100 Subject: ci: fix lint if notmuch is not installed The linter goes completely crazy when notmuch is not installed and the notmuch build tag is enabled. With an otherwise successful lint, the following output is generated: worker/notmuch/lib/database.go:14:10: could not import github.com/zenhack/go.notmuch (-: # github.com/zenhack/go.notmuch ../../go/pkg/mod/github.com/brunnre8/go.notmuch@v0.0.0-20201126061756-caa2daf7093c/configList.go:9:11: fatal error: notmuch.h: No such file or directory 9 | // #include | ^~~~~~~~~~~ compilation terminated.) (typecheck) notmuch "github.com/zenhack/go.notmuch" ^ commands/eml.go:4:2: "bytes" imported and not used (typecheck) "bytes" ^ aerc.go:39:7: previous case (typecheck) case *widgets.AccountView: ^ exit status 1 make: *** [Makefile:73: lint] Error 1 Only include the notmuch build tag in the lint process if it is actually installed. Signed-off-by: Moritz Poldrack Signed-off-by: Robin Jarry --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1874e0ff..4fe6456c 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,8 @@ lint: linters.so @$(GO) run mvdan.cc/gofumpt@$(gofumpt_tag) -d . | grep ^ \ && echo The above files need to be formatted, please run make fmt && exit 1 \ || echo all files formatted. - $(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 run + $(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 run \ + $$(echo $(GOFLAGS) | sed s/-tags=/--build-tags=/) .PHONY: vulncheck vulncheck: -- cgit