chore: migrate to justfile
parent
483d0d50d7
commit
e29d739baa
45
Makefile
45
Makefile
|
@ -1,45 +0,0 @@
|
|||
.PHONY: all test test-color coverage coverage-cli coverate-html lint format build clean
|
||||
|
||||
all:
|
||||
go mod tidy
|
||||
$(MAKE) format
|
||||
$(MAKE) test-color
|
||||
$(MAKE) lint
|
||||
$(MAKE) build
|
||||
$(MAKE) clean
|
||||
|
||||
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 ./...
|
||||
|
||||
coverage-cli:
|
||||
$(MAKE) coverage
|
||||
go tool cover -func=coverage.out
|
||||
|
||||
coverage-html:
|
||||
$(MAKE) coverage
|
||||
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
|
||||
# go install mvdan.cc/sh/v3/cmd/shfmt@latest
|
||||
gofimports -w --company github.com/make-go-great,github.com/haunt98 .
|
||||
gofumpt -w -extra .
|
||||
shfmt -w -s -i 4 ./scripts ./data/zsh
|
||||
|
||||
build:
|
||||
$(MAKE) clean
|
||||
go build ./cmd/dot
|
||||
|
||||
clean:
|
||||
rm -rf dot
|
|
@ -430,6 +430,7 @@ require("lazy").setup({
|
|||
"go",
|
||||
"javascript",
|
||||
"json",
|
||||
"just",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
|
@ -451,6 +452,7 @@ require("lazy").setup({
|
|||
go = { "gofumpt" },
|
||||
javascript = { "deno_fmt" },
|
||||
json = { "deno_fmt" },
|
||||
just = { "just" },
|
||||
lua = { "stylua" },
|
||||
markdown = { "deno_fmt" },
|
||||
proto = { "buf" },
|
||||
|
|
|
@ -136,6 +136,11 @@ if command -v fnm &>/dev/null; then
|
|||
eval "$(fnm env --use-on-cd)"
|
||||
fi
|
||||
|
||||
# https://github.com/casey/just
|
||||
if command -v just &>/dev/null; then
|
||||
alias jst="just"
|
||||
fi
|
||||
|
||||
# https://github.com/crate-ci/typos
|
||||
if command -v typos &>/dev/null; then
|
||||
alias typo="typos --config ~/.config/typos/typos.toml"
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
all: tidy format test-color lint build clean
|
||||
|
||||
tidy:
|
||||
go mod tidy
|
||||
|
||||
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 ./...
|
||||
|
||||
coverage-cli: coverage
|
||||
go tool cover -func=coverage.out
|
||||
|
||||
coverage-html: coverage
|
||||
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
|
||||
# go install mvdan.cc/sh/v3/cmd/shfmt@latest
|
||||
gofimports -w --company github.com/make-go-great,github.com/haunt98 .
|
||||
gofumpt -w -extra .
|
||||
shfmt -w -s -i 4 ./scripts ./data/zsh
|
||||
|
||||
build:
|
||||
go build ./cmd/dot
|
||||
|
||||
clean:
|
||||
rm -rf dot
|
Loading…
Reference in New Issue