Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims
This commit is contained in:
35
Makefile
35
Makefile
@@ -13,18 +13,24 @@ GOLDFLAGS += -X main.Version=$(VERSION)
|
||||
GOLDFLAGS += -X main.Gitrev=$(GITREV_BUILD)
|
||||
GOFLAGS := -ldflags "$(GOLDFLAGS)"
|
||||
|
||||
.PHONY: docker default run ci test check lint fmt fmt-check hooks fixme
|
||||
.PHONY: bootstrap setup docker default run ci test check lint fmt fmt-check hooks fixme
|
||||
|
||||
default: fmt test
|
||||
|
||||
bootstrap:
|
||||
@script/bootstrap
|
||||
|
||||
setup:
|
||||
@script/setup
|
||||
|
||||
run: ./bin/mfer
|
||||
./$<
|
||||
./$< gen
|
||||
|
||||
ci: test
|
||||
|
||||
test: $(SOURCEFILES) mfer/mf.pb.go
|
||||
go test -v --timeout 10s ./...
|
||||
test:
|
||||
@script/test
|
||||
|
||||
$(PROTOC_GEN_GO):
|
||||
test -e $(PROTOC_GEN_GO) || go install -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
|
||||
@@ -32,14 +38,14 @@ $(PROTOC_GEN_GO):
|
||||
fixme:
|
||||
@grep -nir fixme . | grep -v Makefile
|
||||
|
||||
check: test lint fmt-check
|
||||
check:
|
||||
@script/check
|
||||
|
||||
fmt-check: mfer/mf.pb.go
|
||||
sh -c 'test -z "$$(gofmt -l .)"'
|
||||
fmt-check:
|
||||
@script/fmt-check
|
||||
|
||||
hooks:
|
||||
echo '#!/bin/sh\nmake check' > .git/hooks/pre-commit
|
||||
chmod +x .git/hooks/pre-commit
|
||||
@script/install-precommit
|
||||
|
||||
devprereqs:
|
||||
which golangci-lint || go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@v2.0.2
|
||||
@@ -54,17 +60,14 @@ bin/mfer: $(SOURCEFILES) mfer/mf.pb.go
|
||||
clean:
|
||||
rm -rfv mfer/*.pb.go bin/mfer cmd/mfer/mfer *.dockerimage
|
||||
|
||||
fmt: mfer/mf.pb.go
|
||||
gofumpt -l -w mfer internal cmd
|
||||
golangci-lint run --fix
|
||||
-prettier -w *.json
|
||||
-prettier -w *.md
|
||||
fmt:
|
||||
@script/fmt
|
||||
|
||||
lint:
|
||||
golangci-lint run
|
||||
sh -c 'test -z "$$(gofmt -l .)"'
|
||||
@script/lint
|
||||
|
||||
docker: sneak-mfer.$(ARCH).tzst.dockerimage
|
||||
docker:
|
||||
@script/docker
|
||||
|
||||
sneak-mfer.$(ARCH).tzst.dockerimage: $(SOURCEFILES) vendor.tzst modcache.tzst
|
||||
docker build --progress plain --build-arg GITREV=$(GITREV_BUILD) -t sneak/mfer .
|
||||
|
||||
Reference in New Issue
Block a user