-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
31 lines (25 loc) · 792 Bytes
/
justfile
File metadata and controls
31 lines (25 loc) · 792 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
binary := "vulners"
module := "github.com/kidoz/vulners-cli"
version := env("VERSION", "dev")
commit := `git rev-parse --short HEAD 2>/dev/null || echo "none"`
date := `date -u +"%Y-%m-%dT%H:%M:%SZ"`
ldflags := "-s -w -X '" + module + "/internal/cmd.Version=" + version + "' -X '" + module + "/internal/cmd.Commit=" + commit + "' -X '" + module + "/internal/cmd.Date=" + date + "'"
# Build the binary
build:
CGO_ENABLED=0 go build -ldflags "{{ldflags}}" -o {{binary}} ./cmd/vulners/
# Run unit tests
test:
go test -race ./...
# Run integration tests (requires VULNERS_API_KEY)
test-integration:
go test -tags=integration ./...
# Run linter
lint:
golangci-lint run
# Format code
fmt:
gofumpt -w .
# Remove build artifacts
clean:
rm -f {{binary}}
rm -rf dist/