/
githubmirror
/
rsyslog
Обзор
Документация
Войти
/
githubmirror
/
rsyslog
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/CI/check_commit_text.py
17 строк
626 B
Rainer Gerhards
python: clean up style and add optional checks
22 май 2026, 12:02
22 май 2026, 12:02
44a8a00
Код
Авторство
О чём код?
#!/usr/bin/env python # Copyright (c) 2019 by Rainer Gerhards, released under ASL 2.0 import sys rc = 0 max_line_length = 72 # github limit; actually lending towards smaller (50) is better len_hash = 9 # we use 8-char hash plus space with open(sys.argv[1], "r") as f: for line in f: len_line = len(line) - len_hash if len_line > max_line_length: sys.stderr.write("This commit line is {} characters too long (maximum is {}, line len is {}):\n".format( len_line - max_line_length, max_line_length, len_line)) sys.stderr.write(line) rc = 1 sys.exit(rc)