trufflehog/Makefile

69 lines
2 KiB
Makefile
Raw Normal View History

PROTOS_IMAGE ?= trufflesecurity/protos:1.22
.PHONY: check
2022-05-24 04:13:32 +00:00
.PHONY: lint
.PHONY: test
.PHONY: test-race
.PHONY: run
.PHONY: install
.PHONY: protos
.PHONY: protos-windows
.PHONY: vendor
2022-01-20 05:31:48 +00:00
.PHONY: dogfood
dogfood:
CGO_ENABLED=0 go run . git file://. --json --debug
install:
CGO_ENABLED=0 go install .
check:
go fmt $(shell go list ./... | grep -v /vendor/)
go vet $(shell go list ./... | grep -v /vendor/)
2022-05-24 04:13:32 +00:00
lint:
2023-04-03 20:21:58 +00:00
golangci-lint run --enable bodyclose --enable exportloopref --out-format=colored-line-number --timeout 10m
2022-05-24 04:13:32 +00:00
2022-01-19 06:24:56 +00:00
test-failing:
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/) | grep FAIL
2022-01-19 06:24:56 +00:00
test:
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
test-integration:
CGO_ENABLED=0 go test -timeout=5m -tags=integration $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
test-race:
CGO_ENABLED=1 go test -timeout=5m -race $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
2022-01-19 17:27:22 +00:00
test-detectors:
CGO_ENABLED=0 go test -tags=detectors -timeout=5m $(shell go list ./... | grep pkg/detectors)
test-community:
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors | grep -v pkg/sources)
bench:
CGO_ENABLED=0 go test $(shell go list ./pkg/secrets/... | grep -v /vendor/) -benchmem -run=xxx -bench .
run:
CGO_ENABLED=0 go run . git file://. --json
run-debug:
CGO_ENABLED=0 go run . git file://. --json --debug
protos:
docker run --rm -u "$(shell id -u)" -v "$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))":/pwd "${PROTOS_IMAGE}" bash -c "cd /pwd; /pwd/scripts/gen_proto.sh"
protos-windows:
docker run --rm -v "$(shell cygpath -w $(shell pwd))":/pwd "${PROTOS_IMAGE}" bash -c "cd /pwd; ./scripts/gen_proto.sh"
2022-03-11 05:41:35 +00:00
release-protos-image:
docker buildx build --push --platform=linux/amd64,linux/arm64 \
-t ${PROTOS_IMAGE} -f hack/Dockerfile.protos .
2022-03-11 05:41:35 +00:00
snifftest:
./hack/snifftest/snifftest.sh
test-release:
goreleaser release --rm-dist --skip-publish --snapshot