mirror of
https://github.com/uutils/shadow.git
synced 2026-06-10 16:14:57 -07:00
202acc16c9
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/
28 lines
796 B
Bash
Executable File
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}"
|