portgraph 0.16.0

Data structure library for directed graphs with first-level ports.
Documentation
#!/bin/sh

# A pre-push hook for rust codebases that checks formatting, clippy, and tests

set -eu

if [[ "${IGNORE_RUSTHOOKS:=0}" -ne 0 ]]; then
    echo "Ignoring rusthooks"
    exit 0
fi

if ! cargo fmt --all -- --check
then
    echo "There are some code style issues."
    echo "Run cargo fmt first."
    exit 1
fi

if ! cargo check --all --all-features --workspace
then
    echo "There are some compilation warnings."
    exit 1
fi

if ! cargo test --features "proptest,serde,petgraph"
then
    echo "There are some test issues."
    exit 1
fi

if ! cargo clippy --all-targets --all-features --workspace -- -D warnings
then
    echo "There are some clippy issues."
    exit 1
fi

RUSTDOCFLAGS="-Dwarnings"
if ! cargo doc --no-deps --all-features --workspace
then
    echo "There are some clippy issues."
    exit 1
fi

exit 0