PYTHON?=python -X dev
all: help
help:
@echo -e "Specify a command. The choices are:\n"
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[0;36m%-12s\033[m %s\n", $$1, $$2}'
@echo ""
.PHONY: help
format: isort black rustfmt
make -C python format
.PHONY: format
fmt: format
.PHONY: fmt
isort:
ruff check --fix --config python/pyproject.toml --select=I scripts benches
ruff check --fix --config python/pyproject.toml --select=RUF022 scripts benches
@echo -e "\e[1;32mruff isort clean!\e[0m"
.PHONY: isort
black:
ruff format --config python/pyproject.toml scripts benches
@echo -e "\e[1;32mruff format clean!\e[0m"
.PHONY: black
rustfmt:
cargo fmt -- src/*.rs tests/*.rs benches/*.rs
@echo -e "\e[1;32mrustfmt clean!\e[0m"
.PHONY: rustfmt
lint: typos reuse ruff clippy
make -C python lint
.PHONY: lint
typos:
typos --sort
@echo -e "\e[1;32mtypos clean!\e[0m"
.PHONY: typos
reuse:
$(PYTHON) -m reuse lint
@echo -e "\e[1;32mREUSE compliant!\e[0m"
.PHONY: reuse
clippy:
cargo clippy --all-targets --all-features
@echo -e "\e[1;32mclippy clean!\e[0m"
.PHONY: clippy
ruff:
ruff check --config python/pyproject.toml python scripts benches
@echo -e "\e[1;32mruff lint clean!\e[0m"
.PHONY: ruff
pin:
cargo update
make -C python pin
.PHONY: pin
build:
cargo build --locked --all-features --verbose
.PHONY: build
test:
RUST_BACKTRACE=1 cargo test --tests
.PHONY: test
clean:
rm -rf target
make -C python clean
.PHONY: clean
purge: clean
rm -rf .ruff_cache
make -C python purge
.PHONY: purge