.PHONY: help install test test-unit test-integration coverage build build-check clean release-test

help:
	@echo "lauren-guards — make targets"
	@echo ""
	@echo "  make install          editable install with [dev] extras"
	@echo "  make test             run the full test suite"
	@echo "  make test-unit        run only unit tests"
	@echo "  make test-integration run only integration tests"
	@echo "  make coverage         run the full suite under coverage (enforces >90% gate)"
	@echo "  make build            build wheel + sdist into dist/"
	@echo "  make build-check      run twine check on built artifacts"
	@echo "  make clean            remove build/test artifacts"
	@echo "  make release-test     upload to TestPyPI"

install:
	pip install -e .[dev]

test:
	pytest -q

test-unit:
	pytest tests/unit/ -q

test-integration:
	pytest tests/integration/ -q

coverage:
	pytest tests --cov=lauren_guards --cov-branch --cov-fail-under=90 --ignore=tests/benchmarks -q

build: clean
	python -m build

build-check: build
	python -m twine check dist/*

clean:
	rm -rf build/ dist/ *.egg-info src/*.egg-info .pytest_cache .ruff_cache
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true

release-test: build-check
	python -m twine upload --repository testpypi dist/*
