Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
just: Introduce justfile with pre-push hook cmds
Adrian Duke committed 1 month ago
commit 993b15d9370459178537cda9d49632633718a2b6
parent 4fe34358719405df62f17b31449ab8356bd6e1b2
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