Split long commit message to multiple lines to respect the maximun of 80 characters per line imposed by Lantian
This commit is contained in:
parent
5c5481ea57
commit
0824d02cd6
1 changed files with 12 additions and 5 deletions
17
gitdch
17
gitdch
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue