Files
marktvogt.de/Justfile

87 lines
2.5 KiB
Makefile

default:
@just --list
# ── Backend ───────────────────────────────────────────────────────────────────
# Run backend linter
backend-lint:
cd backend && golangci-lint run ./...
# Run backend tests
backend-test:
cd backend && go test ./... -v -count=1
# Run backend tests with coverage
backend-test-cover:
cd backend && go test ./... -v -count=1 -coverprofile=coverage.out
cd backend && go tool cover -html=coverage.out -o coverage.html
# Format backend code
backend-fmt:
cd backend && gofmt -w .
cd backend && goimports -w .
# Build backend binary
backend-build:
cd backend && go build -o api ./cmd/api
# Start backend dev infrastructure (Postgres + Valkey)
backend-dev:
cd backend && docker compose -f deploy/docker-compose.yml up -d
# Stop backend dev infrastructure
backend-dev-down:
cd backend && docker compose -f deploy/docker-compose.yml down
# Run backend API server
backend-run:
cd backend && go run ./cmd/api
# ── Web ───────────────────────────────────────────────────────────────────────
# Run web linter
web-lint:
cd web && pnpm run lint
# Run web format check
web-fmt-check:
cd web && pnpm run format:check
# Format web code
web-fmt:
cd web && pnpm run format
# Run svelte-check (type checking)
web-check:
cd web && pnpm run check
# Run web dev server
web-dev:
cd web && pnpm run dev
# Build web
web-build:
cd web && pnpm run build
# ── All ───────────────────────────────────────────────────────────────────────
# Run all linters
lint: backend-lint web-lint web-fmt-check web-check
# Run all tests
test: backend-test
# Run all formatters
fmt: backend-fmt web-fmt
# Install pre-commit hooks, web deps, and correct golangci-lint version
hooks-install:
pre-commit install
pnpm --dir web install --frozen-lockfile
cd backend && GOTOOLCHAIN=local go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
[ -f web/.env ] || cp web/.env.example web/.env
# Run all pre-commit hooks against all files (skips branch protection — use feature branches for commits)
hooks-run:
SKIP=no-commit-to-branch pre-commit run --all-files