-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (39 loc) · 1.26 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
# Test unit
.PHONY: test
test:
go test -race -timeout 3m ./...
# Install tools
.PHONY: install-tools
install-tools:
@echo Installing tools from tools/tool.go
@cat tools/tool.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
# Install pre-commit hooks. This requires pre-commit to be installed (https://pre-commit.com/)
#.PHONY: install-hooks
#install-hooks:
# pre-commit install
.PHONY: lint
lint:
golangci-lint run --config .golangci.yml
.PHONY: gen-mocks
gen-mocks:
go install github.com/golang/mock/[email protected]
grep -rl '// Code generated by codegen; DO NOT EDIT.' ./client/services/* | xargs rm
go run codegen/main.go
grep -rl '// Code generated by MockGen. DO NOT EDIT.' ./client/mocks/* | xargs rm
go generate ./client/...
go run client/mockassert/main.go
.PHONY: gen-docs
gen-docs:
rm -rf ./docs/tables/*
go run main.go doc ./docs/tables
sed 's_(\(.*\))_(https://github.com/OpsHelmInc/cloudquery/blob/main/docs/tables/\1)_' docs/tables/README.md > ./website/pages/docs/tables.md
go run main.go doc --format json docs
rm docs/__tables.json
.PHONY: gen-spec-schema
gen-spec-schema:
# required for loading comments from AWS SDK
go mod vendor
go run client/spec/gen/main.go
# All gen targets
.PHONY: gen
gen: gen-spec-schema gen-mocks gen-docs