.PHONY: lint format type-check pre-commit-all test test-cov test-unit test-watch

lint: ## use CHECK=1 for check-only mode in CI
ifeq ($(CHECK),1)
	uv run ruff check cognite
	uv run ruff format --check cognite
	uv run pyright --warnings cognite
else
	uv run ruff format cognite
	uv run ruff check --fix cognite
	uv run pyright cognite
endif

format: ## Run ruff formatting
	uv run ruff format cognite

type-check: ## Run pyright type checking
	uv run pyright cognite

test: ## Run all tests
	uv run pytest

test-cov: ## Run tests with coverage report
	uv run pytest --cov=cognite --cov-report=term-missing

test-unit: ## Run only unit tests
	uv run pytest -m unit

test-watch: ## Run tests in watch mode (requires pytest-watch)
	uv run ptw

pre-commit-all: ## Run all pre-commit hooks on all files
	uv run pre-commit run --all-files
