Split long commit message to multiple lines to respect the maximun of 80 characters per line imposed by Lantian
All checks were successful
ci/woodpecker/tag/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Benjamin Renard 2022-12-12 11:32:27 +01:00
parent 5c5481ea57
commit 0824d02cd6

17
gitdch
View file

@ -7,6 +7,7 @@ import logging
import os
import re
import sys
import textwrap
import git
@ -267,11 +268,17 @@ for version in versions:
)
)
# pylint: disable=consider-using-f-string
changelog_lines.extend([
' * {0}\n'.format(message)
for message in version['messages']
])
for message in version['messages']:
for idx, line in enumerate(
textwrap.wrap(message, 76, break_long_words=True)
):
# pylint: disable=consider-using-f-string
changelog_lines.append(
'{0}{1}\n'.format(
' * ' if not idx else ' ',
line
)
)
# pylint: disable=consider-using-f-string
changelog_lines.append(