Makefile 831 B

12345678910111213141516171819202122232425262728293031323334353637
  1. .PHONY: test test-cover failfast profile clean format build
  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/version.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: config/gitleaks.toml format
  12. go test -v ./... --race $(PKG)
  13. failfast: format
  14. go test -failfast ./...
  15. build: config/gitleaks.toml format
  16. go mod tidy
  17. go build $(LDFLAGS)
  18. lint:
  19. golangci-lint run
  20. clean:
  21. rm -rf profile
  22. find . -type f -name '*.got.*' -delete
  23. find . -type f -name '*.out' -delete
  24. profile: build
  25. ./scripts/profile.sh './gitleaks' '.'
  26. config/gitleaks.toml: $(wildcard cmd/generate/config/**/*)
  27. go generate ./...