This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (50 loc) · 1.62 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
51
52
53
54
55
56
57
58
59
.DEFAULT_GOAL := help
.PHONY: help
# Based on https:##gist.github.com/rcmachado/af3db315e31383502660
## Display this help text
help:/
$(info Available targets)
$(info -----------------)
@awk '/^[a-zA-Z\-%\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
if (helpMessage) { \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
gsub(/##/, "\n ", helpMessage); \
printf "%-35s - %s\n", helpCommand, helpMessage; \
lastLine = "" \
} \
} \
{ hasComment = match(lastLine, /^## (.*)/); \
if(hasComment) { \
lastLine=lastLine$$0; \
} \
else { \
lastLine = $$0 \
} \
}' $(MAKEFILE_LIST)
# --------------------------------------
# Testing
# --------------------------------------
.PHONY: test
## run all tests excluding fixtures and vendored packages
test:
@go test ./... -v --failfast
# --------------------------------------
# Linting
# --------------------------------------
.PHONY: lint
## run golangci-lint against project
lint: install-golangci-lint
@$(shell go env GOPATH)/bin/golangci-lint run -v -c .golangci.yml ./...
.PHONY: install-golangci-lint
## Install development tools.
install-golangci-lint:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin
# --------------------------------------
# Installing
# --------------------------------------
.PHONY: install
## build the binary and copy into $(GOPATH)/bin
install:
go install github.com/codeready-toolchain/argocd-checker@master