/
niceSOFT
/
python3-hatchling
Обзор
Документация
Войти
/
niceSOFT
/
python3-hatchling
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
scripts/validate_history.py
35 строк
1000 B
Dimitri Papadopoulos Orfanos
Upgrade Ruff to 0.13.2 (#1890)
28 сен 2025, 21:20
Не верифицирован
28 сен 2025, 21:20
aff6f39
Код
Авторство
О чём код?
import re import sys from utils import ROOT HEADER_PATTERN = ( r"^\[([a-z0-9.]+)\]\(https://github\.com/pypa/hatch/releases/tag/({package}-v\1)\)" r" - [0-9]{{4}}-[0-9]{{2}}-[0-9]{{2}} ## \{{: #\2 \}}$" ) def main(): for package in ("hatch", "hatchling"): history_file = ROOT / "docs" / "history" / f"{package}.md" current_pattern = HEADER_PATTERN.format(package=package) with history_file.open("r", encoding="utf-8") as f: for raw_line in f: line = raw_line.strip() if not line: continue if line.startswith("## "): _, _, header = line.partition(" ") if header == "Unreleased": continue if not re.search(current_pattern, header): print("Invalid header:") print(header) sys.exit(1) if __name__ == "__main__": main()