-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (48 loc) · 1.22 KB
/
Makefile
File metadata and controls
61 lines (48 loc) · 1.22 KB
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
52
53
54
55
56
57
58
59
60
61
default: all
## default: Runs build and test
.PHONY: default
all: help
# =================================== HELPERS =================================== #
## help: print this help message
.PHONY: help
help:
@echo 'CTFx Logger - A CTF hosting platform'
@echo ''
@echo 'Usage: make [target]'
@echo ''
@echo 'Commands:'
@sed -n 's/^## //p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /'
## install: Install dependencies
.PHONY: install
install:
go get ./...
## test: Runs tests
.PHONY: test
test:
go mod tidy
go mod verify
go vet ./...
go test -race ./...
## bench: Run benchmarks
bench:
go test -v -bench=. -benchmem ./...
## lint: Lint code
.PHONY: lint
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
## security: Run security checks
.PHONY: security
security:
go run github.com/securego/gosec/v2/cmd/gosec@latest -quiet ./...
go run github.com/go-critic/go-critic/cmd/gocritic@latest check -enableAll ./...
go run github.com/google/osv-scanner/cmd/osv-scanner@latest -r .
## fmt: Format code
.PHONY: fmt
fmt:
go fmt ./...
go mod tidy -v
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run --fix
## tidy: Clean up code artifacts
.PHONY: tidy
tidy:
go clean ./...