(result, file_path)
| 2421 | |
| 2422 | |
| 2423 | def fmt_validate(result, file_path): |
| 2424 | warnings = result.get("warnings") or [] |
| 2425 | if result["valid"] and not warnings: |
| 2426 | print(f"✅ {file_path} frontmatter 合规") |
| 2427 | return |
| 2428 | if result["valid"]: |
| 2429 | print(f"⚠️ {file_path} frontmatter 合规但有警告:") |
| 2430 | else: |
| 2431 | print(f"❌ {file_path} frontmatter 不合规:") |
| 2432 | for err in result["errors"]: |
| 2433 | print(f" - {err}") |
| 2434 | for w in warnings: |
| 2435 | print(f" ⚠ {w}") |
| 2436 | |
| 2437 | |
| 2438 | def fmt_source_issues(items: list[dict]): |