mirror of
https://github.com/rtk-ai/rtk.git
synced 2026-09-19 07:33:17 +08:00
8678bd8e32
Release-please bumps Cargo.toml but not docs, causing the version grep to fail after every release. The check adds no value since docs don't need to track the exact patch version. Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
78 lines
2.5 KiB
YAML
78 lines
2.5 KiB
YAML
name: Documentation Validation
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'src/**/*.rs'
|
|
- '**.md'
|
|
- '.claude/hooks/*.sh'
|
|
push:
|
|
branches:
|
|
- master
|
|
- feat/**
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Validate documentation consistency
|
|
run: bash scripts/validate-docs.sh
|
|
|
|
- name: Check module count consistency
|
|
run: |
|
|
MAIN_MODULES=$(grep -c '^mod ' src/main.rs)
|
|
|
|
# Check ARCHITECTURE.md if it exists
|
|
if [ -f "ARCHITECTURE.md" ]; then
|
|
ARCH_MODULES=$(grep 'Total:.*modules' ARCHITECTURE.md | grep -o '[0-9]\+' | head -1)
|
|
if [ -n "$ARCH_MODULES" ] && [ "$MAIN_MODULES" != "$ARCH_MODULES" ]; then
|
|
echo "❌ Module count mismatch"
|
|
echo "main.rs: $MAIN_MODULES modules"
|
|
echo "ARCHITECTURE.md: $ARCH_MODULES modules"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo "✅ Module count consistent: $MAIN_MODULES modules"
|
|
|
|
- name: Verify Python/Go commands documented
|
|
run: |
|
|
for cmd in ruff pytest pip go golangci; do
|
|
if ! grep -q "$cmd" README.md; then
|
|
echo "❌ README.md missing Python/Go command: $cmd"
|
|
exit 1
|
|
fi
|
|
if ! grep -q "$cmd" CLAUDE.md; then
|
|
echo "❌ CLAUDE.md missing Python/Go command: $cmd"
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "✅ All Python/Go commands documented"
|
|
|
|
- name: Verify hook coverage
|
|
run: |
|
|
HOOK_FILE=".claude/hooks/rtk-rewrite.sh"
|
|
if [ ! -f "$HOOK_FILE" ]; then
|
|
echo "❌ Hook file not found: $HOOK_FILE"
|
|
exit 1
|
|
fi
|
|
|
|
# Since PR #241, the hook delegates to `rtk rewrite` (single source of truth).
|
|
# Command coverage is now in src/discover/registry.rs, not the hook bash script.
|
|
if ! grep -q "rtk rewrite" "$HOOK_FILE"; then
|
|
echo "❌ Hook does not delegate to 'rtk rewrite'"
|
|
exit 1
|
|
fi
|
|
|
|
# Verify all Python/Go commands are covered in the registry
|
|
# Since PR #241, constants live in src/discover/rules.rs (extracted from registry.rs)
|
|
for cmd in ruff pytest pip golangci; do
|
|
if ! grep -qr "\"$cmd\"" src/discover/; then
|
|
echo "❌ Registry missing rewrite_prefixes for: $cmd"
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "✅ Hook delegates to rtk rewrite, registry covers all Python/Go commands"
|