Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Spruce up Makefile a little (#5347)
Charlie Gunyon4dd8831c5f12
diff --git a/.gitignore b/.gitignoreindex afaf047df..e78f7fe9a 100644--- a/.gitignore+++ b/.gitignore@@ -2,6 +2,7 @@dist.env*.test+[._]*.sw[a-p]# rapid property test failure recordings, for local reproduction onlytestdata/rapid/diff --git a/Makefile b/Makefileindex e9065d9ed..bbf06b773 100644--- a/Makefile+++ b/Makefile@@ -1,70 +1,86 @@-PROTOS_IMAGE ?= trufflesecurity/protos:1.22+.DEFAULT_GOAL := help+.PHONY: help+.PHONY: run+.PHONY: run-debug+.PHONY: dogfood+.PHONY: install.PHONY: check.PHONY: lint+.PHONY: test-failing.PHONY: test+.PHONY: test-integration.PHONY: test-race-.PHONY: run-.PHONY: install+.PHONY: test-detectors+.PHONY: test-community+.PHONY: bench.PHONY: protos.PHONY: protos-windows-.PHONY: vendor-.PHONY: dogfood+.PHONY: release-protos-image.PHONY: man+.PHONY: test-release++PROTOS_IMAGE ?= trufflesecurity/protos:1.22-dogfood:+help: ## Display this help message+ @echo "Usage: make [target]"+ @echo+ @echo "Targets:"+ @awk '/^[a-zA-Z0-9_-]+:.*## / {printf "%s : %s\n", $$1, substr($$0, index($$0, "##") + 3)}' $(MAKEFILE_LIST) | sort | column -t -s ':'+ @echo++run: ## Run a git scan on this repository+ CGO_ENABLED=0 go run . git file://. --json++run-debug: ## Run a git scan on this repository with enhanced logging (level 2)CGO_ENABLED=0 go run . git file://. --json --log-level=2-install:+dogfood: run-debug++install: ## Run go installCGO_ENABLED=0 go install .-check:+check: ## Run go fmt and go vetgo fmt $(shell go list ./... | grep -v /vendor/)go vet $(shell go list ./... | grep -v /vendor/)-lint:+lint: ## Run the linter./scripts/lint.sh-test-failing:+test-failing: ## Run tests, displaying only the failuresCGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/) | grep FAIL-test:+test: ## Run testsCGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/)-test-integration:+test-integration: ## Run integration testsCGO_ENABLED=0 go test -timeout=5m -tags=integration $(shell go list ./... | grep -v /vendor/)-test-race:+test-race: ## Run the go race condition checkerCGO_ENABLED=1 go test -timeout=5m -race $(shell go list ./... | grep -v /vendor/)-test-detectors:+test-detectors: ## Run detector testsCGO_ENABLED=0 go test -tags=detectors -timeout=5m $(shell go list ./... | grep pkg/detectors)-test-community:+test-community: ## Run a subset of tests intended for use by the OSS communityCGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/sources | grep -v pkg/analyzer/analyzers)-bench:+bench: ## Run benchmarksCGO_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 --log-level=2--protos:+protos: ## Regenerate protocol buffer codedocker 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:+protos-windows: ## Regenerate protocol buffer code on Windowsdocker run --rm -v "$(shell cygpath -w $(shell pwd))":/pwd "${PROTOS_IMAGE}" bash -c "cd /pwd; ./scripts/gen_proto.sh"-release-protos-image:+release-protos-image: ## Build a Docker image suitable for generating the protocol buffer codedocker buildx build --push --platform=linux/amd64,linux/arm64 \-t ${PROTOS_IMAGE} -f hack/Dockerfile.protos .-man:+man: ## Build man pages@mkdir -p docs/manCGO_ENABLED=0 go run . --generate-man-page > docs/man/trufflehog.1-test-release:+test-release: ## Test a goreleaser releasegoreleaser release --clean --skip=publish,sign --snapshot