-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1.14 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
47
48
49
50
51
.PHONY: all build test lint fmt check-fmt clean coverage vet ast staticcheck
.DEFAULT_GOAL := all
test:
@go test -v ./...
lint:
@golangci-lint run
fmt:
@gofmt -s -w .
check-fmt:
@gofmt -l . | tee /dev/stderr | grep -q '^' && echo "Code is not formatted" && exit 1 || echo "Code is formatted"
coverage:
@mkdir -p coverage
@go test -coverprofile=coverage/coverage.out ./... && \
go tool cover -func=coverage/coverage.out && \
go tool cover -html=coverage/coverage.out -o coverage/coverage.html; \
open coverage/coverage.html
coverage-ci:
@mkdir -p coverage
@go test -coverprofile=coverage/coverage.out ./... && \
go tool cover -func=coverage/coverage.out
vet:
@go vet ./...
staticcheck:
@staticcheck ./...
ast:
@gosec . ./internal/...
docs:
@echo $$(sleep 2 && open http://localhost:6060/pkg/github.com/ren3gadem4rm0t/imperva-export-cli/internal/cmd/) &
@godoc -play -http localhost:6060 -v
clean:
@go clean
@rm -f ./coverage.out ./coverage.html coverage/coverage.out coverage/coverage.html
@rm -rf ./coverage
@rm -f imperva-export-cli
@rm -rf ./dist
build:
@go build -o imperva-export-cli .
all: test lint fmt vet staticcheck ast