mirror of
https://github.com/rjNemo/payit
synced 2026-06-06 02:16:40 +00:00
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
31 lines
832 B
Makefile
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
|