.PHONY: install test lint format typecheck check build deploy clean

# Defaults — override on the command line, e.g. `make deploy STACK=recommender-forwarder-prod`.
STACK ?= recommender-s3-forwarder
REGION ?= us-east-1

install:
	uv sync

test:
	uv run pytest

lint:
	uv run ruff check .
	uv run cfn-lint template.yaml

format:
	uv run ruff format .

typecheck:
	uv run pyright src/

check: lint typecheck test

build:
	sam build --template template.yaml

deploy: build
	sam deploy \
	  --template-file .aws-sam/build/template.yaml \
	  --stack-name $(STACK) \
	  --region $(REGION) \
	  --capabilities CAPABILITY_IAM \
	  --resolve-s3 \
	  --no-confirm-changeset \
	  --parameter-overrides $(PARAMS)

clean:
	rm -rf .aws-sam .pytest_cache .ruff_cache
