forked from rtk-ai/rtk
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.53 KB
/
validate-docs.yml
File metadata and controls
78 lines (68 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Documentation Validation
on:
pull_request:
paths:
- 'src/**/*.rs'
- 'Cargo.toml'
- '**.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"