-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (33 loc) · 865 Bytes
/
Makefile
File metadata and controls
43 lines (33 loc) · 865 Bytes
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
.PHONY: test
GOLINT_BINARY ?= golangci-lint
LINT_FIX ?= true
lint: lint_deps
@$(GOLINT_BINARY) --version
ifeq ($(LINT_FIX),true)
@printf "lint with fix...\n"; \
$(GOLINT_BINARY) run --fix;
else
@printf "lint without fix...\n"; \
$(GOLINT_BINARY) run;
endif
@if [ $$? != 0 ]; then \
printf "lint failed\n"; \
exit -1; \
else \
printf "lint ok\n"; \
fi
lint_deps: gofmt vet
vet:
@go vet ./...
gofmt:
@GO111MODULE=off gofmt -l $(shell find . -type f -name '*.go'| grep -v "/vendor/\|/.git/")
copyright_check:
@python3 copyright.py --dry-run && \
{ echo "copyright check ok"; exit 0; } || \
{ echo "copyright check failed"; exit -1; }
copyright_check_auto_fix:
@python3 copyright.py --fix
test:
CGO_CFLAGS=-Wno-undef-prefix go test -timeout 99999m -cover ./...
show_metrics:
@promlinter list . --add-help -o md --with-vendor