-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
31 lines (25 loc) · 887 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
all: lint test
### go tests
## By default this will only test memdb, goleveldb, and pebbledb, which do not require cgo
test:
@echo "--> Running go test"
@go test $(PACKAGES) -v
test-rocksdb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags rocksdb -v
golangci_version=v1.55.0
#? lint-install: Install golangci-lint
lint-install:
@echo "--> Installing golangci-lint $(golangci_version)"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
.PHONY: lint-install
lint:
@echo "--> Running linter"
$(MAKE) lint-install
@golangci-lint run
@go mod verify
.PHONY: lint
format:
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofumpt -w -l .
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs golangci-lint run --fix .
.PHONY: format