forked from RedHatInsights/insights-operator-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 1.04 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
.PHONY: help clean build fmt lint vet run test style cyclo
SOURCES:=$(shell find . -name '*.go')
default: build
clean: ## Run go clean
@go clean
build: ## Run go build
@go build
fmt: ## Run go fmt -w for all sources
@echo "Running go formatting"
./gofmt.sh
lint: ## Run golint
@echo "Running go lint"
./golint.sh
vet: ## Run go vet. Report likely mistakes in source code
@echo "Running go vet"
./govet.sh
cyclo: ## Run gocyclo
@echo "Running gocyclo"
./gocyclo.sh
style: fmt vet lint cyclo ## Run all the formatting related commands (fmt, vet, lint, cyclo)
run: clean build ## Build the project and executes the binary
./insights-operator-controller
test: clean build ## Run the unit tests
@go test -coverprofile coverage.out $(shell go list ./... | grep -v tests)
help: ## Show this help screen
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
@echo ''
@echo 'Available targets are:'
@echo ''
@grep -E '^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo ''