aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-07-02 18:38:27 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-04 15:05:30 +0200
commitc992206a1d8b6e537fe1782d025c25ea77bce06d (patch)
tree724ed6ceb179555b56bf63afb4a82eca7c948f25 /Makefile
parentfcb219b67eb296b6781f81074e9cb5b09163f734 (diff)
tools/syz-linter: add custom linter
For now we have 2 simple checks: 1. for multiline comments: /* */ -> // 2. for string len comparison with 0: len(str) != 0 -> str != "" Update #1876
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index bced8120d..2b7fd2668 100644
--- a/Makefile
+++ b/Makefile
@@ -51,6 +51,7 @@ export CGO_ENABLED
TARGETGOOS := $(TARGETOS)
TARGETGOARCH := $(TARGETVMARCH)
export GO111MODULE=on
+export GOBIN=$(shell realpath .)/bin
GITREV=$(shell git rev-parse HEAD)
ifeq ("$(shell git diff --shortstat)", "")
@@ -141,7 +142,7 @@ endif
# syz-sysgen generates them all at once, so we can't make each of them an independent target.
.PHONY: descriptions
descriptions:
- @export GOBIN="$(realpath .)/bin"; go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
+ go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
$(MAKE) .descriptions
.descriptions: sys/*/*.txt sys/*/*.const bin/syz-sysgen
@@ -260,8 +261,9 @@ tidy:
lint:
# This should install the command from our vendor dir.
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
- golangci-lint run ./...
+ CGO_ENABLED=1 $(HOSTGO) install github.com/golangci/golangci-lint/cmd/golangci-lint
+ CGO_ENABLED=1 $(HOSTGO) build -buildmode=plugin -o bin/syz-linter.so ./tools/syz-linter
+ bin/golangci-lint run ./...
arch_darwin_amd64_host:
env HOSTOS=darwin HOSTARCH=amd64 $(MAKE) host