-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 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
40
41
42
43
44
.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:
@go test -coverprofile=coverage.out ./... && go tool cover -html=coverage.out -o coverage.html
vet:
@go vet ./...
staticcheck:
@staticcheck ./...
ast:
@gosec ./parser/... examples/...
docs:
@echo $$(sleep 2 && open http://localhost:6060/pkg/github.com/ren3gadem4rm0t/cef-parser-go/parser/) &
@godoc -play -http localhost:6060 -v
clean:
@go clean
@rm -f ./coverage.out ./coverage.html
fuzz:
@echo "Running fuzz tests..."
@fuzz_tests=("FuzzParseCEF" "FuzzParseExtensions" "FuzzAsJSON" "FuzzSecurityCEF" "FuzzStructuredCEF"); \
for fuzz_test in $${fuzz_tests[@]}; do \
echo "Running fuzz test: $$fuzz_test"; \
go test ./parser -fuzz=$$fuzz_test -fuzztime=30s; \
done
all: test lint fmt vet staticcheck ast