Files
Pierre Warnier 202acc16c9 README: rewrite following uutils format, add local Docker git hooks
README.md: project overview with CVE motivation, goals, tool status
table, Docker build/test/lint instructions, architecture diagram,
test matrix, contributing guidelines with GPL clean-room warning.

hooks/: local CI via Docker (no GitHub Actions, no cloud):
- pre-commit: cargo fmt + clippy on Debian (~5s)
- pre-push: fmt + clippy + tests on Debian/Alpine/Fedora (~30s)
- install.sh: symlinks hooks into .git/hooks/
2026-03-23 13:13:36 +01:00

28 lines
796 B
Bash
Executable File

#!/usr/bin/env bash
# shadow-rs pre-commit hook — runs fmt check and clippy in Docker.
# Install: ./hooks/install.sh
#
# Fast checks only (no full test suite — that's pre-push).
# Runs in ~5s on a warm Docker cache.
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
echo "pre-commit: checking formatting..."
if ! docker compose run --rm -T debian cargo fmt --all --check 2>&1; then
echo -e "${RED}FAILED${NC}: cargo fmt --all --check"
echo "Run: docker compose run --rm debian cargo fmt --all"
exit 1
fi
echo "pre-commit: running clippy..."
if ! docker compose run --rm -T debian cargo clippy --workspace --all-targets -- -D warnings 2>&1; then
echo -e "${RED}FAILED${NC}: cargo clippy"
exit 1
fi
echo -e "${GREEN}pre-commit: all checks passed${NC}"