-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
39 lines (30 loc) · 857 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
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
GOLANG_CI_YAML_PATH ?= ${ROOT_DIR}/golang-ci.yaml
GOLANG_CI_ARGS ?= --allow-parallel-runners --timeout=5m --config=${GOLANG_CI_YAML_PATH}
# Build
build:
@go build -o ./bin/stackit
fmt:
@gofmt -s -w .
# Setup and tool initialization tasks
project-help:
@$(SCRIPTS_BASE)/project.sh help
project-tools:
@$(SCRIPTS_BASE)/project.sh tools
# Lint
lint-golangci-lint:
@echo "Linting with golangci-lint"
@golangci-lint run ${GOLANG_CI_ARGS}
lint-yamllint:
@echo "Linting with yamllint"
@yamllint -c .yamllint.yaml .
lint: lint-golangci-lint lint-yamllint
# Test
test:
@echo "Running tests for the CLI application"
@go test ./... -count=1
# Generate docs
generate-docs:
@echo "Generating docs..."
@go run $(SCRIPTS_BASE)/generate.go