posts-go/Makefile

54 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-12-20 18:45:20 +00:00
$(MAKE) format
2023-01-22 04:55:58 +00:00
$(MAKE) test-color
$(MAKE) lint
$(MAKE) gen
$(MAKE) format-html
2022-12-25 19:18:02 +00:00
test:
go test -race -failfast ./...
test-color:
2024-02-10 01:50:52 +00:00
# go install github.com/haunt98/go-test-color@latest
2022-12-25 19:18:02 +00:00
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:
2024-02-10 01:50:52 +00:00
# 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:
2024-01-07 08:01:10 +00:00
# bun upgrade
2023-12-01 10:21:57 +00:00
bunx prettier@latest --write ./templates ./docs
2024-01-07 08:01:10 +00:00
# deno upgrade
2023-08-05 19:13:47 +00:00
deno fmt ./posts
2023-04-19 08:49:56 +00:00
srht:
# https://srht.site/quickstart
2024-02-10 01:50:52 +00:00
# go install git.sr.ht/~emersion/hut@latest
2023-04-19 08:49:56 +00:00
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