Makefile 1023 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. PKGS := github.com/pkg/errors
  2. SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS))
  3. GO := go
  4. check: test vet gofmt unused misspell unconvert gosimple ineffassign
  5. test:
  6. $(GO) test $(PKGS)
  7. vet: | test
  8. $(GO) vet $(PKGS)
  9. staticcheck:
  10. $(GO) get honnef.co/go/tools/cmd/staticcheck
  11. staticcheck $(PKGS)
  12. unused:
  13. $(GO) get honnef.co/go/tools/cmd/unused
  14. unused -exported $(PKGS)
  15. misspell:
  16. $(GO) get github.com/client9/misspell/cmd/misspell
  17. misspell \
  18. -locale GB \
  19. -error \
  20. *.md *.go
  21. unconvert:
  22. $(GO) get github.com/mdempsky/unconvert
  23. unconvert -v $(PKGS)
  24. gosimple:
  25. $(GO) get honnef.co/go/tools/cmd/gosimple
  26. gosimple $(PKGS)
  27. ineffassign:
  28. $(GO) get github.com/gordonklaus/ineffassign
  29. find $(SRCDIRS) -name '*.go' | xargs ineffassign
  30. pedantic: check unparam errcheck staticcheck
  31. unparam:
  32. $(GO) get mvdan.cc/unparam
  33. unparam ./...
  34. errcheck:
  35. $(GO) get github.com/kisielk/errcheck
  36. errcheck $(PKGS)
  37. gofmt:
  38. @echo Checking code is gofmted
  39. @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)"