-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
50 lines (38 loc) · 1.21 KB
/
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
41
42
43
44
45
46
47
48
49
50
LICENSEI_VERSION = 0.9.0
GOLANGCI_VERSION = 1.59.0
all: license fmt vet test
.PHONY: license
license: bin/licensei
bin/licensei header
# Run go fmt against code
fmt:
go fmt ./...
# Run go vet against code
vet:
go vet ./...
test:
go test ./...
test-integration:
cd tests && go test -integration -v ./...
bin/licensei: bin/licensei-${LICENSEI_VERSION}
@ln -sf licensei-${LICENSEI_VERSION} bin/licensei
bin/licensei-${LICENSEI_VERSION}:
@mkdir -p bin
curl -sfL https://raw.githubusercontent.com/goph/licensei/master/install.sh | bash -s v${LICENSEI_VERSION}
@mv bin/licensei $@
.PHONY: license-check
license-check: bin/licensei ## Run license check
bin/licensei check
bin/licensei header
.PHONY: license-cache
license-cache: bin/licensei ## Generate license cache
bin/licensei cache
bin/golangci-lint: bin/golangci-lint-${GOLANGCI_VERSION}
@ln -sf golangci-lint-${GOLANGCI_VERSION} bin/golangci-lint
bin/golangci-lint-${GOLANGCI_VERSION}:
@mkdir -p bin
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/v${GOLANGCI_VERSION}/install.sh | bash -s -- -b ./bin/ v${GOLANGCI_VERSION}
@mv bin/golangci-lint $@
.PHONY: lint
lint: bin/golangci-lint ## Run linter
bin/golangci-lint run ${LINTER_FLAGS}