Files
rtk-ai__rtk/.claude/hooks/bash/pre-commit-format.sh
Florian BRUNIAUX d8f4659ad7 chore: add Claude Code agents, commands, skills, hooks and rules
Add project-specific Claude Code configuration for RTK development:

- 5 agents: code-reviewer, debugger, rtk-testing-specialist, rust-rtk, technical-writer
- 2 commands: /diagnose (env checks), /test-routing (dry-run validation)
- 1 hook: pre-commit cargo fmt + clippy + test gate
- 1 rule: CLI testing methodology (snapshot, token accuracy, cross-platform)
- 3 skills: performance optimization, security audit, release workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 09:37:48 +01:00

17 lines
413 B
Bash
Executable File

#!/bin/bash
# Auto-format Rust code before commits
# Hook: PreToolUse for git commit
echo "🦀 Running Rust pre-commit checks..."
# Format code
cargo fmt --all
# Check for compilation errors only (warnings allowed)
if cargo clippy --all-targets 2>&1 | grep -q "error:"; then
echo "❌ Clippy found errors. Fix them before committing."
exit 1
fi
echo "✅ Pre-commit checks passed (warnings allowed)"