payit/Makefile
Ruidy aaf1289f6b
feat(dev): add Air config and Makefile dev target
Add .air.toml for live reload development with Air. Update Makefile to
include a 'dev' target that starts Air with custom cache directories.
Improve .gitignore to exclude 'tmp' directory used by Air.

Refactor frontend JS to use querySelector for robustness. Update HTML
template to fix form method, script loading, and message div syntax.
c
2025-09-28 14:16:18 +02:00

31 lines
832 B
Makefile

SHELL := /bin/bash
GOFILES := $(shell find . -path './.modcache' -prune -o -path './.cache' -prune -o -name '*.go' -print)
GOCACHE ?= $(CURDIR)/.cache
GOMODCACHE ?= $(CURDIR)/.modcache
GOFLAGS ?= -count=1
.PHONY: dev fmt lint test clean tidy
dev:
@echo "Starting development environment"
@GOCACHE=$(GOCACHE) GOMODCACHE=$(GOMODCACHE) air -c .air.toml
fmt:
@echo "Formatting Go files"
@gofmt -w $(GOFILES)
lint:
@echo "Running linters"
@GOCACHE=$(GOCACHE) GOMODCACHE=$(GOMODCACHE) go vet ./...
@GOCACHE=$(GOCACHE) GOMODCACHE=$(GOMODCACHE) golangci-lint run --timeout=5m
test:
@echo "Running tests with coverage"
@GOCACHE=$(GOCACHE) GOMODCACHE=$(GOMODCACHE) go test $(GOFLAGS) -cover ./...
clean:
@rm -rf $(GOCACHE) $(GOMODCACHE)
tidy:
@echo "Tidying go.mod"
@GOCACHE=$(GOCACHE) GOMODCACHE=$(GOMODCACHE) go mod tidy