4 ms·
> vendor directories are ignored by the go tool #19090: Hooray! No more Makefile spaghetti like this (well a bit less anyway!) GO_FILES := $(shell go lis
by nickcw 9y ago
> vendor directories are ignored by the go tool #19090:
Hooray!
No more Makefile spaghetti like this (well a bit less anyway!)
GO_FILES := $(shell go list ./... | grep -v /vendor/ )
go test $(GO_FILES)
go tool vet . 2>&1 | grep -E -v vendor/ ; test $$? -eq 1
errcheck $(GO_FILES)
find . -name \*.go | grep -v /vendor/ | xargs goimports -d | grep . ; test $$? -eq 1
go list ./... | grep -v /vendor/ | xargs -i golint {} | grep . ; test $$? -eq 1
should become
go test ./...
go tool vet ./...
errcheck ./...
goimports -d .
golint ./...
I assume the `./...` changes will just work in `errcheck` and `golint` but I suspect `goimports` might need a bit of work.
- Kubuxu 9y agoOnly if `go test -cover ./...` would work. Currently in needs a lot of magic [1] (ignore sharness test coverage magic, it uses even more magic [2]). [1]: https://github.com/ipfs/go-ipfs/blob/master/coverage/Rules.mk#L12-L27 https://github.com/ipfs/go-ipfs/blob/master/coverage/Rules.m... [2]: same file as [1], we compile unit test using `go test -c -cover` that runs our main function and saves the return value to file ([3] and [4]), but it works. If someone considers doing that, run everything in ramfs (tmpfs). [3]: https://github.com/ipfs/go-ipfs/blob/master/coverage/main/main.go https://github.com/ipfs/go-ipfs/blob/master/coverage/main/ma... [4]: https://github.com/ipfs/go-ipfs/blob/master/cmd/ipfs/runmain_test.go https://github.com/ipfs/go-ipfs/blob/master/cmd/ipfs/runmain...