-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
43 lines (33 loc) · 990 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
41
42
43
# Copyright IBM Corp All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# -------------------------------------------------------------
# This makefile defines the followng targets
# - all (default) - runs checks and unit-tests
# - unit-test - runs the go-test based unit tests
# - checks - runs vet and go format checks
GOTOOLS_BINDIR ?= $(shell go env GOPATH)/bin
.PHONY: all checks
all: checks unit-tests
checks: license vet gotools fmtcheck
.PHONY: fmtcheck
fmtcheck:
@echo "Checking source code formatting..."
@scripts/check-go-formatting.sh
.PHONY: license
license:
@echo "Checking for license headers..."
@scripts/check-license.sh
.PHONY: vet
vet:
@echo "Running go vet..."
@scripts/run-go-vet.sh
.PHONY: gotools
gotools:
@echo "Installing goimports..."
@cd tools && GOBIN=$(abspath $(GOTOOLS_BINDIR)) go install golang.org/x/tools/cmd/goimports
.PHONY: unit-tests
unit-tests:
@echo "Running unit tests..."
@scripts/run-unit-tests.sh