Makefile: fmt, vet, test, vulncheck, ci
The library has nothing to build; the Makefile only checks, with govulncheck pinned like in the programs (go run ...@v1.9.0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
840e4e96e3
commit
7d5feb21a1
2 files changed
+58
No files matched your search
@@ -0,0 +1,52 @@
|
|||||||
|
# yetano-webui-template is a library (package layout): nothing to build or
|
||||||
|
# publish, only to check. A release is a git tag -- see README.md,
|
||||||
|
# "Versioning note".
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: ci
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
|
test:
|
||||||
|
go test ./... -race
|
||||||
|
|
||||||
|
.PHONY: fmt
|
||||||
|
fmt:
|
||||||
|
@out="$$(gofmt -l .)"; \
|
||||||
|
if [ -n "$$out" ]; then \
|
||||||
|
echo "not gofmt'ed:"; echo "$$out"; exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
.PHONY: fmt-fix
|
||||||
|
fmt-fix:
|
||||||
|
gofmt -w .
|
||||||
|
|
||||||
|
.PHONY: vet
|
||||||
|
vet:
|
||||||
|
go vet ./...
|
||||||
|
|
||||||
|
# govulncheck at a pinned version via "go run" -- no global install. Not
|
||||||
|
# part of test on purpose: it needs network access to vuln.go.dev, and
|
||||||
|
# since that database changes daily, a check would start failing without
|
||||||
|
# any code change (see ../TODO.md "govulncheck in allen Go-Modulen").
|
||||||
|
GOVULNCHECK ?= go run golang.org/x/vuln/cmd/govulncheck@v1.9.0
|
||||||
|
|
||||||
|
.PHONY: vulncheck
|
||||||
|
vulncheck:
|
||||||
|
$(GOVULNCHECK) ./...
|
||||||
|
|
||||||
|
.PHONY: tidy
|
||||||
|
tidy:
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
.PHONY: ci
|
||||||
|
ci: fmt vet test vulncheck
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@echo "Targets:"
|
||||||
|
@echo " ci fmt + vet + test + vulncheck (the default)"
|
||||||
|
@echo " fmt fail if a file is not gofmt'ed (fmt-fix rewrites them)"
|
||||||
|
@echo " vet go vet"
|
||||||
|
@echo " test go test -race"
|
||||||
|
@echo " vulncheck govulncheck $(subst go run ,,$(GOVULNCHECK))"
|
||||||
|
@echo " tidy go mod tidy"
|
||||||
@@ -145,6 +145,12 @@ deliverable (Go templates) doesn't apply. It adopted the same dark
|
|||||||
palette independently in its own stylesheet instead, plus its own
|
palette independently in its own stylesheet instead, plus its own
|
||||||
light/dark toggle — see its `internal/yaais/static/style.css`.
|
light/dark toggle — see its `internal/yaais/static/style.css`.
|
||||||
|
|
||||||
|
## Checks
|
||||||
|
|
||||||
|
`make ci` (the default target) runs `fmt`, `vet`, `test` (with `-race`)
|
||||||
|
and `vulncheck` (govulncheck at a pinned version, needs network access).
|
||||||
|
Run it before tagging.
|
||||||
|
|
||||||
## Versioning note
|
## Versioning note
|
||||||
|
|
||||||
Use `v0.1.5` or later. `v0.1.3` and `v0.1.4` were force-moved to
|
Use `v0.1.5` or later. `v0.1.3` and `v0.1.4` were force-moved to
|
||||||
|
|||||||
Reference in new issue
Block a user