-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (28 loc) · 1.01 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
REPO_NAME := dhc-common
install-code-check:
@echo "** install 3rd party static code checkers **"
# scan code staticcheck.io using standard config - find lint and additional issues
go install honnef.co/go/tools/cmd/staticcheck@latest
#scan code for security issues
# old pre go 1.16 command go get -u github.com/securego/gosec/v2/cmd/gosec
go install github.com/securego/gosec/v2/cmd/gosec@latest
code-check:
@echo "** static code checks **"
# scan code staticcheck.io using standard config
staticcheck ./...
#scan code with vet finds more issues than compiler
go vet ./...
#scan code for security issues, only interested in medium of higher
gosec -quiet -fmt=json -confidence=medium -tests=true ./...
drone-test:
@make install-code-check
@make code-check
@echo "** Drone Testing (short) **"
go get -v -d -t ./...
go clean -testcache
go test -short -mod=readonly -covermode=atomic ./...
test:
@make code-check
go get -v -d -t ./...
go clean -testcache
go test -mod=readonly -covermode=atomic ./...