CARGO ?= cargo
PYTHON ?= python3
.DEFAULT_GOAL := help
.PHONY: help build release install run test test-pym test-ci lint fmt fmt-check check sets demo doc clean
help:
@printf '\033[1mleetctl\033[0m — make targets\n\n'
@grep -hE '^[a-zA-Z0-9_-]+:.*?## ' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-11s\033[0m %s\n", $$1, $$2}'
@printf '\nPass arguments to a run with ARGS, e.g. `make run ARGS="review --all"`.\n'
build:
$(CARGO) build
release:
$(CARGO) build --release
install:
$(CARGO) install --path .
run: ## Run the debug binary, e.g. `make run ARGS="review next"`
$(CARGO) run -- $(ARGS)
test:
$(CARGO) test
test-pym:
$(CARGO) test --features pym
test-ci:
$(CARGO) nextest run --release --all-features
lint:
$(CARGO) clippy --all-targets --all-features -- -D warnings
fmt:
$(CARGO) fmt
fmt-check:
$(CARGO) fmt --check
check: fmt-check lint test
sets:
$(PYTHON) scripts/gen_sets.py
demo: release
PATH="$$(pwd)/target/release:$$PATH" vhs docs/demo.tape
gifsicle -O3 --lossy=40 --colors 96 docs/public/demo.gif -o docs/public/demo.gif
doc:
$(CARGO) doc --no-deps --open
clean:
$(CARGO) clean