-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
23 lines (16 loc) · 764 Bytes
/
Makefile
File metadata and controls
23 lines (16 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
GO_MODULE_DIR := .
GOCACHE_DIR := /tmp/go-build
GOMODCACHE_DIR := $(CURDIR)/pkg/mod
GOPATH_DIR := /tmp/go
.PHONY: fmt fmt-check test validate lint verify
fmt:
cd $(GO_MODULE_DIR) && find problems util -type f -name '*.go' -print0 | xargs -0 gofmt -w
fmt-check:
cd $(GO_MODULE_DIR) && test -z "$$(find problems util -type f -name '*.go' -print0 | xargs -0 gofmt -l)"
test:
cd $(GO_MODULE_DIR) && GO111MODULE=on GOPATH=$(GOPATH_DIR) GOCACHE=$(GOCACHE_DIR) GOMODCACHE=$(GOMODCACHE_DIR) go test ./problems/... ./util/...
validate:
./scripts/validate_solutions.sh
lint:
cd $(GO_MODULE_DIR) && GO111MODULE=on GOPATH=$(GOPATH_DIR) GOCACHE=$(GOCACHE_DIR) GOMODCACHE=$(GOMODCACHE_DIR) golangci-lint run ./problems/... ./util/...
verify: fmt-check validate test