.PHONY: test checkstyle coverage all

all: checkstyle test

# Command to run pytest for correctness tests
test:
	python -m pytest --disable-warnings \
		--cov=src/chalk \
		--cov-report=term-missing \
		test/

# Command to run coverage report
coverage:
	coverage report -m

# Command to run ruff for linting and formatting code
checkstyle:
	ruff check --output-format=concise .; ruff_check_status=$$?; \
	ruff format --check --diff .; ruff_format_status=$$?; \
	ruff check . --fix; \
	ruff format .; \
	if [ $$ruff_check_status -ne 0 ] || [ $$ruff_format_status -ne 0 ]; then \
		exit 1; \
	fi
