1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#!/usr/bin/env sh # Versioned pre-commit hook. Install with: # git config core.hooksPath hooks # chmod +x hooks/pre-commit # Unix only set -e echo "▶ cargo fmt --check" cargo fmt --all --check echo "▶ cargo clippy" cargo clippy --all-targets -- -D warnings echo "▶ rustdoc" RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --quiet 2>&1 | grep -v "^$" || true echo "▶ cargo test --lib" cargo test --lib --quiet echo "▶ pytest (offline only)" if [ -d gflights-py/.venv ]; then cd gflights-py .venv/bin/python -m pytest tests/test_import.py -q 2>/dev/null \ || .venv/Scripts/python.exe -m pytest tests/test_import.py -q 2>/dev/null \ || true cd .. fi