generated from replicatedhq/krew-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
77 lines (57 loc) · 1.38 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# SPDX-FileCopyrightText: 2023 Kalle Fagerberg
#
# SPDX-License-Identifier: CC0-1.0
ifeq ($(OS),Windows_NT)
BINARY := kubectl-klock.exe
else
BINARY := kubectl-klock
endif
GO_FILES=$(shell git ls-files '*.go')
.PHONY: build
build: dist/${BINARY} bin/klock.kubectl-klock.completion.bash
bin/klock.kubectl-klock.completion.bash: dist/${BINARY} go.mod go.sum
KLOCK_USAGE_NAME=klock.kubectl-klock dist/${BINARY} completion bash > bin/klock.kubectl-klock.completion.bash
dist/${BINARY}: dist cmd/*.go pkg/*/*.go VERSION
go build -o dist/${BINARY}
dist:
mkdir dist
.PHONY: clean
clean:
rm -fv dist/${BINARY}
.PHONY: check
check:
go test ./... -coverprofile cover.out
.PHONY: deps
deps: deps-go deps-npm deps-pip
.PHONY: deps-go
deps-go:
go get
.PHONY: deps-npm
deps-npm: node_modules
node_modules:
npm install
.PHONY: deps-pip
deps-pip:
python3 -m pip install --upgrade --user reuse
.PHONY: lint
lint: lint-md lint-go lint-license
.PHONY: lint-fix
lint-fix: lint-md-fix lint-go-fix
.PHONY: lint-md
lint-md: node_modules
npx markdownlint-cli2
.PHONY: lint-md-fix
lint-md-fix: node_modules
npx markdownlint-cli2 --fix
.PHONY: lint-go
lint-go:
@echo goimports -d '**/*.go'
@goimports -d $(GO_FILES)
revive -formatter stylish -config revive.toml ./...
.PHONY: lint-go-fix
lint-go-fix:
@echo goimports -d -w '**/*.go'
@goimports -d -w $(GO_FILES)
.PHONY: lint-license
lint-license:
reuse lint