-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
40 lines (31 loc) · 1.05 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
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) -tags pebbledb -v
test-rocksdb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags rocksdb -v
test-pebble:
@echo "--> Running go test"
@go test $(PACKAGES) -tags pebbledb -v
test-all:
@echo "--> Running go test"
@go test $(PACKAGES) -tags rocksdb,pebbledb -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