posts-go/Makefile

55 lines
1.1 KiB
Makefile
Raw Normal View History

2023-04-19 08:49:56 +00:00
.PHONY: all test test-color coverage coverage-cli coverage-html lint format gen format-html srht
2022-07-12 06:57:31 +00:00
2023-01-22 04:55:58 +00:00
all:
2022-12-25 19:18:02 +00:00
go mod tidy
2023-01-22 04:55:58 +00:00
$(MAKE) test-color
$(MAKE) lint
$(MAKE) format
$(MAKE) gen
$(MAKE) format-html
2023-05-02 17:38:15 +00:00
$(MAKE) srht
2022-12-25 19:18:02 +00:00
test:
go test -race -failfast ./...
test-color:
go install github.com/haunt98/go-test-color@latest
go-test-color -race -failfast ./...
coverage:
go test -coverprofile=coverage.out ./...
2023-01-22 04:55:58 +00:00
coverage-cli:
$(MAKE) coverage
2022-12-25 19:18:02 +00:00
go tool cover -func=coverage.out
2023-01-22 04:55:58 +00:00
coverage-html:
$(MAKE) coverage
2022-12-25 19:18:02 +00:00
go tool cover -html=coverage.out
lint:
golangci-lint run ./...
format:
go install github.com/haunt98/gofimports/cmd/gofimports@latest
go install mvdan.cc/gofumpt@latest
2023-04-04 10:25:22 +00:00
gofimports -w --company github.com/make-go-great,github.com/haunt98 .
2022-12-25 19:18:02 +00:00
gofumpt -w -extra .
2022-07-12 06:57:31 +00:00
gen:
go run .
2022-12-30 09:32:52 +00:00
format-html:
bun upgrade
2023-08-05 19:13:47 +00:00
bun install --global prettier
prettier --write ./templates ./docs
deno fmt ./posts
2023-04-19 08:49:56 +00:00
srht:
# https://srht.site/quickstart
go install git.sr.ht/~emersion/hut@latest
tar -C docs -cvz . > site.tar.gz
# Need to run hut init first
hut pages publish -d youngyoshie.srht.site site.tar.gz
rm -rf site.tar.gz