From 9210f0871a234d2810613943bb9c2258957d79a0 Mon Sep 17 00:00:00 2001 From: Adrian Duke Date: Wed, 8 Apr 2026 17:14:20 +0100 Subject: [PATCH] just: Introduce justfile with pre-push hook cmds As part of migrating from `flake.nix` to a more universal task runner that can manage git hooks too. --- justfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 justfile diff --git a/justfile b/justfile new file mode 100644 index 00000000..5e5d4245 --- /dev/null +++ b/justfile @@ -0,0 +1,26 @@ +default: + @just --list + +# Run pre-push checks +pre-push: lint-rust + @echo "✅ pre-push passed" + +# Run Clippy lints +lint-rust: (verify-tool "cargo") + @echo "Cargo clippy..." + @cargo clippy --workspace --all-targets --all-features -- --deny warnings + +# Check if required tools are in PATH. +[private] +verify-tool tool package_name="": + #!/usr/bin/env bash + set -e + if ! command -v {{tool}} >/dev/null 2>&1; then + PKG="{{package_name}}" + if [ -z "$PKG" ]; then + PKG="{{tool}}" + fi + echo "❌ Missing required tool: {{tool}}" + echo "💡 Use your systems package manager to install '$PKG'." + exit 1 + fi