Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims

This commit is contained in:
2026-07-07 01:57:08 +02:00
parent 1fc11529ed
commit c246bfc455
16 changed files with 374 additions and 9 deletions

View File

@@ -7,8 +7,16 @@ GIT_COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
LDFLAGS := -X 'git.eeqj.de/sneak/secret/internal/cli.Version=$(VERSION)' \
-X 'git.eeqj.de/sneak/secret/internal/cli.GitCommit=$(GIT_COMMIT)'
.PHONY: default bootstrap setup test lint fmt fmt-check check docker hooks vet
default: check
bootstrap:
@script/bootstrap
setup:
@script/setup
build: ./secret
./secret: ./internal/*/*.go ./pkg/*/*.go ./cmd/*/*.go ./go.*
@@ -17,24 +25,25 @@ build: ./secret
vet:
go vet ./...
test: vet
go test ./... || go test -v ./...
test:
@script/test
fmt:
go fmt ./...
@script/fmt
lint:
golangci-lint run --timeout 5m
@script/lint
check: build lint test fmt-check
check:
@script/check
# Build Docker container
docker:
docker build -t sneak/secret .
@script/docker
# Run Docker container interactively
docker-run:
docker run --rm -it sneak/secret
docker run --rm -it "$$(./script/projectname)"
# Clean build artifacts
clean:
@@ -44,4 +53,7 @@ install: ./secret
cp ./secret $(HOME)/bin/secret
fmt-check:
@test -z "$$(gofmt -l .)" || (echo "Files need formatting:" && gofmt -l . && exit 1)
@script/fmt-check
hooks:
@script/install-precommit