-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (35 loc) · 1.33 KB
/
Makefile
File metadata and controls
50 lines (35 loc) · 1.33 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
PKG = github.com/k1LoW/mo
COMMIT = $(shell git rev-parse --short HEAD)
BUILD_LDFLAGS = "-s -w -X $(PKG)/version.Revision=$(COMMIT)"
default: test
ci: depsdev generate test
generate:
go generate ./internal/static/
test:
cd internal/frontend && pnpm install && pnpm run test:coverage
go test ./... -coverprofile=coverage.out -covermode=count -count=1
build: generate
go build -ldflags=$(BUILD_LDFLAGS) -trimpath -o mo .
dev: build
./mo -p 16275 --foreground $(ARGS)
screenshot: build
cd internal/frontend && pnpm run screenshots
lint:
cd internal/frontend && pnpm install && pnpm run fmt:check && pnpm run lint
golangci-lint run ./...
go vet -vettool=`which gostyle` -gostyle.config=$(PWD)/.gostyle.yml ./...
fmt:
cd internal/frontend && pnpm install && pnpm run fmt
fmt-check:
cd internal/frontend && pnpm install && pnpm run fmt:check
depsdev:
go install github.com/Songmu/gocredits/cmd/gocredits@latest
go install github.com/k1LoW/gostyle@latest
credits: depsdev generate
go mod download
gocredits -w .
printf "\n================================================================\n\n" >> CREDITS
cat internal/frontend/CREDITS_FRONTEND >> CREDITS
prerelease_for_tagpr: credits
git add CHANGELOG.md CREDITS go.mod go.sum
.PHONY: default ci generate test build dev screenshot lint fmt fmt-check depsdev credits prerelease_for_tagpr