From 4392da2d1f67169707abe00d1b68e072b63dd374 Mon Sep 17 00:00:00 2001 From: MoCoAt Date: Wed, 15 Oct 2025 13:20:56 +0200 Subject: [PATCH] ci/docs: stabilize validator (quote backticks; remove brittle code-block syntax check; use pre-increments) --- scripts/validation/validate-docs.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/validation/validate-docs.sh b/scripts/validation/validate-docs.sh index 6ef616c9..c5bd0c35 100755 --- a/scripts/validation/validate-docs.sh +++ b/scripts/validation/validate-docs.sh @@ -160,18 +160,15 @@ check_code_examples() { ((++CHECKS)) # Find Kotlin code blocks and check basic syntax - kotlin_blocks=$(grep -r "```kotlin" docs/ | wc -l) + kotlin_blocks=$(grep -r '```kotlin' docs/ | wc -l) if [ "$kotlin_blocks" -gt 0 ]; then log_success "Found $kotlin_blocks Kotlin code examples" else log_warning "No Kotlin code examples found in documentation" fi - # Check for common syntax issues in code blocks - syntax_issues=$(grep -A 10 "```kotlin" docs/**/*.md | grep -E "(fun|class|interface)" | grep -v ":" | head -5 || true) - if [ -n "$syntax_issues" ]; then - log_warning "Potential syntax issues in code examples (manual review recommended)" - fi + # Skipping code block syntax checks to avoid false positives in CI + true } # Check documentation completeness score @@ -214,7 +211,7 @@ link_check() { # Optional PlantUML render check plantuml_check() { log_info "Rendering PlantUML diagrams to validate syntax (if 'plantuml' is available)..." - ((CHECKS++)) + ((++CHECKS)) if command -v plantuml &> /dev/null; then # Render to SVG; failures should surface as non-zero exit # Note: This may produce SVGs next to the .puml files in CI workspace