2022-04-08 01:10:23 +00:00
|
|
|
PROTOS_IMAGE ?= trufflesecurity/protos:1.18-0
|
2022-01-13 20:02:24 +00:00
|
|
|
|
|
|
|
.PHONY: check
|
2022-05-24 04:13:32 +00:00
|
|
|
.PHONY: lint
|
2022-01-13 20:02:24 +00:00
|
|
|
.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
|
2022-01-13 20:02:24 +00:00
|
|
|
|
|
|
|
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:
|
2022-01-29 00:51:04 +00:00
|
|
|
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/) | grep FAIL
|
2022-01-19 06:24:56 +00:00
|
|
|
|
2022-01-13 20:02:24 +00:00
|
|
|
test:
|
2022-07-28 20:27:57 +00:00
|
|
|
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
|
2022-01-13 20:02:24 +00:00
|
|
|
|
2022-09-19 20:23:25 +00:00
|
|
|
test-integration:
|
|
|
|
CGO_ENABLED=0 go test -timeout=5m -tags=integration $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
|
|
|
|
|
2022-01-13 20:02:24 +00:00
|
|
|
test-race:
|
2022-07-28 20:27:57 +00:00
|
|
|
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:
|
2022-07-28 20:27:57 +00:00
|
|
|
CGO_ENABLED=0 go test -tags=detectors -timeout=5m $(shell go list ./... | grep pkg/detectors)
|
2022-01-13 20:02:24 +00:00
|
|
|
|
2023-08-01 20:25:33 +00:00
|
|
|
test-community:
|
2023-07-11 13:13:00 +00:00
|
|
|
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors | grep -v pkg/sources)
|
|
|
|
|
2022-01-13 20:02:24 +00:00
|
|
|
bench:
|
|
|
|
CGO_ENABLED=0 go test $(shell go list ./pkg/secrets/... | grep -v /vendor/) -benchmem -run=xxx -bench .
|
|
|
|
|
|
|
|
run:
|
2022-01-19 00:59:18 +00:00
|
|
|
CGO_ENABLED=0 go run . git file://. --json
|
|
|
|
|
|
|
|
run-debug:
|
|
|
|
CGO_ENABLED=0 go run . git file://. --json --debug
|
2022-01-13 20:02:24 +00:00
|
|
|
|
|
|
|
protos:
|
|
|
|
docker run -u "$(shell id -u)" -v "$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))":/pwd "${PROTOS_IMAGE}" bash -c "cd /pwd; /pwd/scripts/gen_proto.sh"
|
2022-02-16 03:19:09 +00:00
|
|
|
|
|
|
|
protos-windows:
|
|
|
|
docker run -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
|
|
|
|
2022-04-08 01:10:23 +00:00
|
|
|
release-protos-image:
|
|
|
|
docker buildx build --push --platform=linux/amd64,linux/arm64 \
|
|
|
|
-t trufflesecurity/protos:1.18-0 -f hack/Dockerfile.protos .
|
|
|
|
|
2022-03-11 05:41:35 +00:00
|
|
|
snifftest:
|
|
|
|
./hack/snifftest/snifftest.sh
|
2022-08-03 20:56:44 +00:00
|
|
|
|
|
|
|
test-release:
|
2023-03-28 16:07:26 +00:00
|
|
|
goreleaser release --rm-dist --skip-publish --snapshot
|