eb92f64e93
Mobile fixes: - Add click toggle handler for hamburger menu (was hover-only) - Menu now opens/closes on tap and closes when clicking outside - Keep hover support for desktop iPad fixes: - Sidebar content now visible on touch devices (901-1280px) - Added (hover: hover) media query to prevent hide-on-hover on tablets Security improvements: - Replace exec.CommandContext with go-git library for git operations - Add path traversal and command injection prevention - Fix race condition in template hot reload - Add environment-based cookie Secure flag Code quality: - Add constants.go for magic numbers - Remove unused code (ParsePreferenceToggleRequest, DomainError) - Add FOUC prevention with inline critical CSS - Add Makefile dev/run/clean targets - Fix README git clone URL - Add doc/DECISIONS.md for architectural decisions Tests: - Add hamburger menu click toggle tests - Add iPad sidebar visibility tests - Update security tests for go-git implementation - Add cookie Secure flag tests
53 lines
1.4 KiB
Makefile
53 lines
1.4 KiB
Makefile
.PHONY: test test-all test-unit test-integration lint build dev run clean
|
|
|
|
# Default: Run unit tests only (fast, no Chrome needed)
|
|
test: test-unit
|
|
|
|
# Run unit tests only (CI-safe, no Chrome)
|
|
test-unit:
|
|
@echo "🧪 Running unit tests..."
|
|
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
# Run ALL tests including PDF/Chrome integration tests
|
|
test-all:
|
|
@echo "🧪 Running ALL tests (including integration tests)..."
|
|
go test -v -race -tags=integration -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
# Run integration tests only
|
|
test-integration:
|
|
@echo "🧪 Running integration tests only..."
|
|
go test -v -race -tags=integration ./internal/handlers -run PDF
|
|
|
|
# Run linter
|
|
lint:
|
|
@echo "🔍 Running golangci-lint..."
|
|
golangci-lint run
|
|
|
|
# Build binary
|
|
build:
|
|
@echo "🔨 Building..."
|
|
go build -v -o cv-server .
|
|
|
|
# Run in development mode with hot reload
|
|
dev:
|
|
@echo "🚀 Starting development server with hot reload..."
|
|
GO_ENV=development TEMPLATE_HOT_RELOAD=true go run main.go
|
|
|
|
# Run in production mode
|
|
run:
|
|
@echo "🚀 Starting server..."
|
|
go run main.go
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
@echo "🧹 Cleaning build artifacts..."
|
|
rm -f cv-server coverage.txt coverage-report.txt benchmark.txt
|
|
|
|
# Run all checks (lint + unit tests)
|
|
check: lint test-unit
|
|
@echo "✅ All checks passed!"
|
|
|
|
# Run everything (lint + all tests + build)
|
|
all: lint test-all build
|
|
@echo "✅ Everything passed!"
|