-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 2.46 KB
/
Makefile
File metadata and controls
64 lines (49 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
help: ## Display this help message
@egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-30s\033[0m %s\n", $$1, $$2}'
###############################################################################
### Build ###
###############################################################################
.PHONY: build
build: mod ## Build the story client.
@mkdir -p build/
@go build -o build/story ./client
.PHONY: mod
mod: ## Update all go.mod files.
@go mod tidy
###############################################################################
### Contracts ###
###############################################################################
.PHONY: contracts-bindings
contract-bindings: ## Generate golang contract bindings.
make -C ./contracts bindings
###############################################################################
### Utils ###
###############################################################################
.PHONY: ensure-detect-secrets
ensure-detect-secrets: ## Checks if detect-secrets is installed.
@which detect-secrets > /dev/null || echo "detect-secrets not installed, see https://github.com/Yelp/detect-secrets?tab=readme-ov-file#installation"
.PHONY: install-pre-commit
install-pre-commit: ## Installs the pre-commit tool as the git pre-commit hook for this repo.
@which pre-commit > /dev/null || echo "pre-commit not installed, see https://pre-commit.com/#install"
@pre-commit install --install-hooks
.PHONY: install-go-tools
install-go-tools: ## Installs the go-dev-tools, like buf.
@go generate scripts/tools.go
.PHONY: lint
lint: ## Runs linters via pre-commit.
@pre-commit run -v --all-files
.PHONY: bufgen
bufgen: ## Generates protobufs using buf generate.
@./scripts/protocgen.sh
.PHONY:
secrets-baseline: ensure-detect-secrets ## Update secrets baseline.
@detect-secrets scan --exclude-file pnpm-lock.yaml > .secrets.baseline
.PHONY: fix-golden
fix-golden: ## Fixes golden test fixtures.
@./scripts/fix_golden_tests.sh
.PHONY: mockgen
mockgen: ## Generates mock files.
@cd scripts && bash mockgen.sh
###############################################################################
### Testing ###
###############################################################################