diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-07-02 18:38:27 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-07-04 15:05:30 +0200 |
| commit | c992206a1d8b6e537fe1782d025c25ea77bce06d (patch) | |
| tree | 724ed6ceb179555b56bf63afb4a82eca7c948f25 /Makefile | |
| parent | fcb219b67eb296b6781f81074e9cb5b09163f734 (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-- | Makefile | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |
