Makefile 559 B

1234567891011121314151617181920212223242526
  1. .PHONY: test test-cover
  2. PKG=github.com/zricethezav/gitleaks
  3. VERSION := `git fetch --tags && git tag | sort -V | tail -1`
  4. LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks/v8/cmd.Version=$(VERSION)"
  5. COVER=--cover --coverprofile=cover.out
  6. test-cover:
  7. go test -v ./... --race $(COVER) $(PKG)
  8. go tool cover -html=cover.out
  9. format:
  10. go fmt ./...
  11. test: format
  12. go vet ./...
  13. go test -v ./... --race $(PKG)
  14. build: format
  15. go vet ./...
  16. go mod tidy
  17. go build $(LDFLAGS)
  18. clean:
  19. find . -type f -name '*.got.*' -delete
  20. find . -type f -name '*.out' -delete