bring repo into compliance with repo policies #14

Merged
sneak merged 15 commits from chore/repo-compliance into main 2026-02-25 14:52:56 +01:00
Showing only changes of commit 0000188265 - Show all commits

View File

@@ -1,4 +1,4 @@
.PHONY: check lint test fmt build clean docker docker-test devserver devserver-stop
.PHONY: check lint test fmt fmt-check build clean docker docker-test devserver devserver-stop hooks
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -X main.Version=$(VERSION)
@@ -21,10 +21,10 @@ lint:
@echo "Running linter..."
golangci-lint run
# Run tests
# Run tests (30-second timeout)
test:
@echo "Running tests..."
go test -v ./...
go test -timeout 30s -v ./...
# Build the binary
build: ./bin/pixad
@@ -58,3 +58,10 @@ devserver: docker devserver-stop
devserver-stop:
-docker stop pixad-dev 2>/dev/null
-docker rm pixad-dev 2>/dev/null
# Install pre-commit hook
hooks:
@printf '#!/bin/sh\nset -e\n' > .git/hooks/pre-commit
@printf 'go mod tidy\ngo fmt ./...\ngit diff --exit-code -- go.mod go.sum || { echo "go mod tidy changed files; please stage and retry"; exit 1; }\n' >> .git/hooks/pre-commit
@printf 'make check\n' >> .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit