h: help
help:
	@echo "Options:"
	@echo "format: Reformat all python files with ruff"
	@echo "tests: Run tests with nosetest"
	@echo "verbose_tests: Run tests with nosetest -v"

docker: local
f: format
t: test
i: image
image: local

format: format_code format_tests

fix_python_imports:
	ruff check --select I --fix gitlike_commands/*.py

lint:
	@echo "Linting with ruff"
	ruff check gitlike_commands/*.py

fixup:
	@echo "Fixing up with ruff"
	ruff check --fix --show-fixes gitlike_commands/*.py

format_code: fix_python_imports lint fixup
	ruff format gitlike_commands/*.py

format_tests:
	ruff format tests/*.py
	ruff check --fix --show-fixes tests/*.py
	ruff check --select I --fix tests/*.py

tests: test
test:
	nosetests

verbose_tests: verbose_test
verbose_test:
	nosetests -v

wheel: clean format
	uv build

local: wheel
	docker buildx build --load -t unixorn/gitlike-commands .

fatimage: wheel
	docker buildx build --platform linux/arm64,linux/amd64 --push -t unixorn/gitlike-commands .
	make local

clean:
	rm -f dist/*

fat:
	make fatimage