/
kreyndelHam
/
Konstructorium
Обзор
Документация
Войти
/
kreyndelHam
/
Konstructorium
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
Безопасность
dev
scripts/docs/check_markdown_style.py
34 строки
989 B
MihahamYT
Code Style + docstrings
22 апр 2026, 00:29
22 апр 2026, 00:29
eea24b4
Код
Авторство
О чём код?
"""Perform basic markdown style checks for project documentation.""" from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[2] DOCS_DIR = ROOT / "docs" def main() -> int: """Run markdown style checks and return process exit code.""" errors: list[str] = [] for md_file in DOCS_DIR.rglob("*.md"): lines = md_file.read_text(encoding="utf-8").splitlines() if not lines or not lines[0].startswith("# "): errors.append(f"{md_file.relative_to(ROOT)}: missing top-level H1") for idx, line in enumerate(lines, start=1): if line.rstrip() != line: errors.append(f"{md_file.relative_to(ROOT)}:{idx}: trailing whitespace") if errors: print("Markdown style check failed:") for item in errors: print(f"- {item}") return 1 print("Markdown style check passed.") return 0 if __name__ == "__main__": raise SystemExit(main())