-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
49 lines (39 loc) · 1.58 KB
/
Makefile
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
.PHONY: gomods
gomods: ## Install gomods
go install github.com/jmank88/gomods@v0.1.3
.PHONY: gomodtidy
gomodtidy: gomods
gomods tidy
.PHONY: docs
docs:
go install golang.org/x/pkgsite/cmd/pkgsite@latest
# http://localhost:8080/pkg/github.com/smartcontractkit/chainlink-common/pkg/
pkgsite
.PHONY: install-protoc
install-protoc:
script/install-protoc.sh 25.1 /
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31; go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
.PHONY: mockery
mockery: $(mockery) ## Install mockery.
go install github.com/vektra/mockery/v2@v2.43.2
.PHONY: rm-mocked
rm-mocked:
grep -rl "^// Code generated by mockery" | grep .go$ | xargs -r rm
.PHONY: rm-builders
rm-builders:
# not sure why, but go.tmpl is matched when run in makefile but not when run in the commandline.
grep -rl "^// Code generated by github.com/smartcontractkit/chainlink-common/pkg/capabilities/cli" | grep .go$ | grep -v go.tmpl$ | xargs -r rm
# test wasm file should be removed as well
rm -f ./pkg/workflows/wasm/host/test/cmd/testmodule.wasm
.PHONY: generate
generate: mockery install-protoc gomods
gomods -w go generate -x ./...
mockery
.PHONY: lint-workspace lint
GOLANGCI_LINT_VERSION := 1.60.1
GOLANGCI_LINT_COMMON_OPTS := --max-issues-per-linter 0 --max-same-issues 0
GOLANGCI_LINT_DIRECTORY := ./golangci-lint
lint-workspace:
@./script/lint.sh $(GOLANGCI_LINT_VERSION) "$(GOLANGCI_LINT_COMMON_OPTS)" $(GOLANGCI_LINT_DIRECTORY)
lint:
@./script/lint.sh $(GOLANGCI_LINT_VERSION) "$(GOLANGCI_LINT_COMMON_OPTS)" $(GOLANGCI_LINT_DIRECTORY) "--new-from-rev=origin/main"