feat: Add Bruno API tests and recent changes validation

Check 14: Bruno API Tests Validation
- Count and verify Bruno .bru test files presence
- Compare API documentation vs Bruno test coverage
- Flag insufficient test coverage for human review

Check 15: Recent Documentation Changes Analysis
- Analyze recent commits for documentation compliance
- Flag code commits without corresponding documentation updates
- Verify proper commit message format (docs: prefix)
- Ensure documentation stays synchronized with code changes

These checks provide comprehensive validation of API testing coverage
and ensure documentation follows proper git commit conventions
per PROJECT_GUIDELINES.md requirements.
This commit is contained in:
2026-02-02 11:32:21 -05:00
parent 5deef46ef5
commit 8d31298861
+51
View File
@@ -367,6 +367,57 @@ 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
###############################################################################
## Summary
###############################################################################