From 0f1b3d4506853a827465f4ca097bfdd9ef43a7bd Mon Sep 17 00:00:00 2001 From: Matteo Cherubini Date: Sun, 10 May 2026 10:10:23 +0200 Subject: [PATCH] refactor: Improve linting error accumulation and link checking --- scripts/lint-genomes.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/lint-genomes.sh b/scripts/lint-genomes.sh index 20cf546..7ec6e23 100644 --- a/scripts/lint-genomes.sh +++ b/scripts/lint-genomes.sh @@ -31,21 +31,15 @@ for entry in "${GENOMES[@]}"; do # Lint all .md files except AGENTS.md and core-karpathy reference while IFS= read -r md_file; do - lint_markdown_file "$md_file" "$GENOME_NAME" - file_errors=$? - TOTAL_ERRORS=$((TOTAL_ERRORS + file_errors)) + lint_markdown_file "$md_file" "$GENOME_NAME" && fe=0 || fe=$? + check_privacy_consistency "$md_file" && pce=0 || pce=$? + check_page_size "$md_file" && pse=0 || pse=$? + TOTAL_ERRORS=$((TOTAL_ERRORS + fe + pce + pse)) - check_privacy_consistency "$md_file" - TOTAL_ERRORS=$((TOTAL_ERRORS + $?)) - - check_page_size "$md_file" - TOTAL_ERRORS=$((TOTAL_ERRORS + $?)) - - check_knowledge_decay "$md_file" - stale=$? + check_knowledge_decay "$md_file" && stale=0 || stale=$? TOTAL_STALE=$((TOTAL_STALE + stale)) - check_broken_links "$md_file" + check_broken_links "$md_file" || true # warnings only, never contributes to errors done < <(find "$genome_dir" -name "*.md" \ ! -name "AGENTS.md" \