1# SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
2#
3# SPDX-License-Identifier: CC0-1.0
4
5default: fmt lint staticcheck test vuln reuse
6
7fmt:
8 # Formatting all Go source code
9 go install mvdan.cc/gofumpt@latest
10 gofumpt -l -w .
11
12lint:
13 # Linting Go source code
14 golangci-lint run
15
16staticcheck:
17 # Performing static analysis
18 go install honnef.co/go/tools/cmd/staticcheck@latest
19 staticcheck ./...
20
21test:
22 # Running tests
23 go test -v ./...
24
25vuln:
26 # Checking for vulnerabilities
27 go install golang.org/x/vuln/cmd/govulncheck@latest
28 govulncheck ./...
29
30reuse:
31 # Linting licenses and copyright headers
32 reuse lint
33
34build:
35 # Building Willow
36 go build -o willow -ldflags "-s -w -X main.version=`git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g'`" ./cmd
37
38clean:
39 # Cleaning up
40 rm -rf willow out/
41
42clean-all:
43 # Removing build artifacts, willow.sqlite, config.toml, and data/ directory
44
45 rm -rf willow out willow.sqlite config.toml data