From ed5a7308bea5d2b8b7c4030ed06f93be04aefad1 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Mon, 2 Feb 2026 10:40:52 -0700 Subject: [PATCH] build: Migrated from Makefile to justfile --- CONTRIBUTING.md | 3 ++- Makefile | 40 ---------------------------------------- justfile | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644 Makefile create mode 100644 justfile diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bdc9843..c53eb7f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,8 @@ cz commit 1. Clone this repo 2. Run `cargo test` to set up hooks 3. Make changes -4. Run the application using `make run` or `cargo run` +4. Run the application using `just run` or `just run` + - Install `just` (`cargo install just`) if you haven't already to use the [justfile](./justfile) in this project. 5. Commit changes. This will trigger pre-commit hooks that will run format, test and lint. If there are errors or warnings from Clippy, please fix them. 6. Push your code to a new branch named after the feature/bug/etc. you're adding. This will trigger pre-push hooks that diff --git a/Makefile b/Makefile deleted file mode 100644 index ecd0d1a..0000000 --- a/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -#!make -default: run - -.PHONY: test test-cov build run lint lint-fix fmt minimal-versions analyze release delete-tag - -test: - @cargo test --all - -## Run all tests with coverage - `cargo install cargo-tarpaulin` -test-cov: - @cargo tarpaulin - -build: test - @cargo build --release - -run: - @CARGO_INCREMENTAL=1 cargo fmt && make lint && cargo run - -lint: - @find . | grep '\.\/src\/.*\.rs$$' | xargs touch && CARGO_INCREMENTAL=0 cargo clippy --all-targets --workspace - -lint-fix: - @cargo fix - -fmt: - @cargo fmt - -minimal-versions: - @cargo +nightly update -Zdirect-minimal-versions - -## Analyze for unsafe usage - `cargo install cargo-geiger` -analyze: - @cargo geiger - -release: - @git tag -a ${V} -m "Release ${V}" && git push origin ${V} - -delete-tag: - @git tag -d ${V} && git push --delete origin ${V} - diff --git a/justfile b/justfile new file mode 100644 index 0000000..b67541f --- /dev/null +++ b/justfile @@ -0,0 +1,35 @@ +# List all recipes +default: + @just --list + +# Format all files +[group: 'style'] +fmt: + @cargo fmt --all + +alias clippy := lint +# Run Clippy to inspect all files +[group: 'style'] +lint: + @cargo clippy --all + +alias clippy-fix := lint-fix +# Automatically fix clippy issues where possible +[group: 'style'] +lint-fix: + @cargo fix + +# Run all tests +[group: 'test'] +test: + @cargo test --all + +# Build and run the binary for the current system +run: + @cargo run + +# Build the project for the current system architecture +[group: 'build'] +[arg('build_type', pattern="debug|release")] +build build_type='debug': + @cargo build {{ if build_type == "release" { "--release" } else { "" } }}