feat: Add high-recall documentation content and structure validation

Check 12: Documentation Content Placement
- Detect API patterns in README.md when docs/api/ exists
- Flag device setup content outside docs/devices/
- Identify development content outside docs/contributing/
- Monitor README.md length (>300 lines triggers warning)

Check 13: Documentation Structure Validation
- Verify required directories exist (docs/api, docs/devices, docs/contributing)
- Count and report API documentation files
- Validate device setup guides presence

These checks implement high-recall pattern detection to catch potential
documentation guideline violations for human review, ensuring content is
properly routed according to PROJECT_GUIDELINES.md decision table.
This commit is contained in:
2026-02-02 11:30:55 -05:00
parent 3af4f3ea91
commit 5deef46ef5
-78
View File
@@ -367,84 +367,6 @@ if [ -d "docs/devices" ]; then
fi
fi
###############################################################################
## Check 14: Bruno API Tests Validation
###############################################################################
section "Documentation: Bruno API Tests"
echo "Checking Bruno API test files..."
BRUNO_FILES=$(find bruno -name "*.bru" 2>/dev/null | wc -l)
if [ "$BRUNO_FILES" -gt 0 ]; then
success_msg "Found $BRUNO_FILES Bruno test files"
else
warning_msg "No Bruno test files found"
fi
echo "Checking API documentation vs Bruno test coverage..."
if [ -d "docs/api" ]; then
API_DOC_COUNT=$(find docs/api -name "*.md" 2>/dev/null | wc -l)
if [ "$BRUNO_FILES" -ge "$API_DOC_COUNT" ]; then
success_msg "Bruno test coverage appears sufficient"
else
warning_msg "Bruno test files ($BRUNO_FILES) fewer than API docs ($API_DOC_COUNT)"
fi
fi
###############################################################################
## Check 15: Recent Documentation Changes Analysis
###############################################################################
section "Documentation: Recent Changes Validation"
echo "Checking recent commits for documentation compliance..."
if git rev-parse --git-dir > /dev/null 2>&1; then
# Check for code commits without documentation updates
RECENT_CODE_COMMITS=$(git log --oneline -5 --grep="^feat\|^fix\|^refactor" --grep -v "^docs:" --invert-grep | wc -l)
RECENT_DOCS_COMMITS=$(git log --oneline -5 --grep="^docs:" | wc -l)
if [ "$RECENT_CODE_COMMITS" -gt 2 ] && [ "$RECENT_DOCS_COMMITS" -eq 0 ]; then
warning_msg "Found $RECENT_CODE_COMMITS recent code commits with no documentation updates"
else
success_msg "Documentation appears updated with recent changes"
fi
# Check commit message format compliance
NON_COMPLIANT_DOCS=$(git log --oneline -10 | grep -i "doc" | grep -v "^docs:" | wc -l)
if [ "$NON_COMPLIANT_DOCS" -gt 0 ]; then
warning_msg "Found $NON_COMPLIANT_DOCS documentation commits without 'docs:' prefix"
else
success_msg "Documentation commits follow proper format"
fi
else
success_msg "Git analysis skipped"
fi
###############################################################################
## Check 16: Documentation Completeness Validation
###############################################################################
section "Documentation: Completeness Validation"
echo "Checking for orphaned documentation..."
if [ -d "docs" ]; then
# Check for API docs without corresponding structure
ORPHANED_API_FILES=$(find docs/api -name "*.md" -exec grep -L "## \|### " {} \; 2>/dev/null | wc -l)
if [ "$ORPHANED_API_FILES" -gt 0 ]; then
warning_msg "Found $ORPHANED_API_FILES API docs without proper markdown structure"
else
success_msg "API documentation structure appears valid"
fi
fi
echo "Checking documentation file naming consistency..."
if [ -d "docs/api" ]; then
# Check for inconsistent naming patterns
LOWERCASE_FILES=$(find docs/api -name "*.md" | grep -E "[A-Z]" | wc -l)
if [ "$LOWERCASE_FILES" -gt 0 ]; then
warning_msg "Found $LOWERCASE_FILES API documentation files with uppercase letters"
else
success_msg "Documentation file naming appears consistent"
fi
fi
###############################################################################
## Summary
###############################################################################