Files
rtk-ai--rtk/scripts/validate-docs.sh
Florian BRUNIAUX bbe3da642b fix(ci): fix validate-docs.sh broken module count check
Two issues:
1. Module count compared top-level `mod` in main.rs (8) against
   "Total: 64 modules" in ARCHITECTURE.md -- incompatible metrics,
   always fails. Replaced with a simple .rs source file count (informational only).
2. CLAUDE.md check for Python/Go commands was too strict -- these
   commands belong in README.md (user-facing), not CLAUDE.md (Claude Code guidance).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-30 18:26:04 +02:00

42 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "🔍 Validating RTK documentation consistency..."
# 1. Source file count sanity check
SRC_FILES=$(find src -name "*.rs" ! -name "mod.rs" ! -name "main.rs" | wc -l | tr -d ' ')
echo "📊 Rust source files in src/: $SRC_FILES"
# 3. Commandes Python/Go présentes partout
PYTHON_GO_CMDS=("ruff" "pytest" "pip" "go" "golangci")
echo "🐍 Checking Python/Go commands documentation..."
for cmd in "${PYTHON_GO_CMDS[@]}"; do
if [ ! -f "README.md" ]; then
echo "⚠️ README.md not found, skipping"
break
fi
if ! grep -q "$cmd" "README.md"; then
echo "❌ README.md ne mentionne pas commande $cmd"
exit 1
fi
done
echo "✅ Python/Go commands: documented in README.md"
# 4. Hooks cohérents avec doc
HOOK_FILE=".claude/hooks/rtk-rewrite.sh"
if [ -f "$HOOK_FILE" ]; then
echo "🪝 Checking hook rewrites..."
for cmd in "${PYTHON_GO_CMDS[@]}"; do
if ! grep -q "$cmd" "$HOOK_FILE"; then
echo "⚠️ Hook may not rewrite $cmd (verify manually)"
fi
done
echo "✅ Hook file exists and mentions Python/Go commands"
else
echo "⚠️ Hook file not found: $HOOK_FILE"
fi
echo ""
echo "✅ Documentation validation passed"