forked from hypebeast/go-osc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (31 loc) · 988 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
PKG = ./osc
all: format coverage
help:
@echo "Usage make [TARGET]"
@echo "TARGETS:"
@echo " all format, build and run tests"
@echo " test runs all tests"
@echo " style checks the code style"
@echo " format runs go fmt"
@echo " vet vetting code"
@echo " lint runs golint"
@echo " coverage runs the tests and creates a coverage report"
test:
@echo ">> Running tests"
@go test -v $(PKG)
coverage:
@echo ">> Running tests with coverage"
@go test -v -covermode=count -coverprofile=coverage.out $(PKG)
style:
@echo ">> Checking code style"
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
format:
@echo ">> Formatting code"
@gofmt -l -w $(shell find . -path ./vendor -prune -o -name '*.go' -print)
vet:
@echo ">> Vetting code"
@go vet $(PKG)
lint:
@echo ">> Linting code"
@golint $(PKG)
.PHONY: all test style format vet coverage lint