File: Makefile

package info (click to toggle)
golang-k8s-sigs-json 0.0~git20211208.9f7c6b3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 588 kB
  • sloc: sh: 86; makefile: 29
file content (35 lines) | stat: -rw-r--r-- 710 bytes parent folder | download
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
.PHONY: default build test benchmark fmt vet

default: build

build:
	go build ./...

test:
	go test sigs.k8s.io/json/...

benchmark:
	go test sigs.k8s.io/json -bench . -benchmem

fmt:
	go mod tidy
	gofmt -s -w *.go

vet:
	go vet sigs.k8s.io/json

	@echo "checking for external dependencies"
	@deps=$$(go mod graph); \
	if [ -n "$${deps}" ]; then \
		echo "only stdlib dependencies allowed, found:"; \
		echo "$${deps}"; \
		exit 1; \
	fi

	@echo "checking for unsafe use"
	@unsafe=$$(go list -f '{{.ImportPath}} depends on {{.Imports}}' sigs.k8s.io/json/... | grep unsafe || true); \
	if [ -n "$${unsafe}" ]; then \
		echo "no dependencies on unsafe allowed, found:"; \
		echo "$${unsafe}"; \
		exit 1; \
	fi