From 289a5d51dcbdc8d2f8b59029fe7efdbf49cb75f1 Mon Sep 17 00:00:00 2001 From: Alexander van Trijffel Date: Tue, 22 Oct 2024 21:55:06 +0200 Subject: [PATCH] chore: improve just recipes --- justfile | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/justfile b/justfile index 6f5c960..5bd25be 100644 --- a/justfile +++ b/justfile @@ -1,16 +1,28 @@ +# override the default just command to show the list of available recipes default: @just --list -build-release: - cargo build --release --verbose - +# lint with clippy clippy-release: cargo clippy --release -- -W warnings -W clippy::pedantic -W clippy::nursery -W clippy::all -W clippy::cargo -W clippy::cognitive_complexity -A clippy::cargo_common_metadata -test-all *ARGS: +# run all tests with nextest +test-all *ARGS: check-dependencies + cargo nextest run --verbose {{ ARGS }} + +# run all tests with nextest in watch mode +test-watch-all *ARGS: check-dependencies + cargo watch -c -w . -x "nextest run --verbose {{ ARGS }}" + +# build the project in release mode +build-release: + cargo build --release --verbose + +# validate that cargo-nextest is installed +check-dependencies: #!/bin/sh ! type cargo-nextest > /dev/null 2>&1 && { - echo "Make sure to install cargo-nextest"; - exit 1; + echo "carg-nextest is not installed. Aborting..."; + exit 1; } - cargo nextest run --verbose {{ ARGS }} + exit 0;