forked from trustwallet/assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (29 loc) · 877 Bytes
/
Makefile
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
#! /usr/bin/make -f
# Go related variables.
GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/bin
# Go files.
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
all: fmt lint test
test:
@echo " > Running unit tests"
GOBIN=$(GOBIN) go test -cover -race -coverprofile=coverage.txt -covermode=atomic -v ./...
fmt:
@echo " > Format all go files"
GOBIN=$(GOBIN) gofmt -w ${GOFMT_FILES}
lint-install:
ifeq (,$(wildcard test -f bin/golangci-lint))
@echo " > Installing golint"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s
endif
lint: lint-install
@echo " > Running golint"
bin/golangci-lint run --timeout=2m
check:
go run ./cmd/main.go --script=checker
fix:
go run ./cmd/main.go --script=fixer
update-auto:
go run ./cmd/main.go --script=updater-auto
update-manual:
go run ./cmd/main.go --script=updater-manual