-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (33 loc) · 934 Bytes
/
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
.PHONY: protoc
protoc:
protoc -I internal/proto \
--go_out internal/proto \
--go_opt paths=source_relative \
--go-grpc_out internal/proto \
--go-grpc_opt paths=source_relative \
internal/proto/test.proto
.PHONY: install
install: plugin.so
@cp plugin.so ${GOPATH}/bin/proto-golint-plugin.so
@ls ${GOPATH}/bin/proto-golint-plugin.so
go install ./cmd/proto-golint
@echo "installed in $(shell which proto-golint)"
plugin.so:
CGO_ENABLED=1 go build -buildmode=plugin ./plugin/proto-golint/plugin.go
.PHONY: clean
clean:
-rm plugin.so
.PHONY: run
run:
go run ./cmd/proto-golint ./internal/test
.PHONY: fix
fix:
go run ./cmd/proto-golint --fix ./internal/test
.PHONY: lint
lint:
golangci-lint run ./...
.PHONY: install-golangci-lint
install-golangci-lint:
CGO_ENABLED=1 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
.PHONY: reinstall
reinstall: clean install install-golangci-lint lint