Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
just: Introduce justfile with pre-push hook cmds
Adrian Duke committed 13 days ago
commit 9210f0871a234d2810613943bb9c2258957d79a0
parent 430868f
1 file changed +26 -0
added 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