diff --git a/ChangeLog.d/make_assemble_changelog_enforce_line_length.txt b/ChangeLog.d/make_assemble_changelog_enforce_line_length.txt new file mode 100644 index 000000000..3baed0205 --- /dev/null +++ b/ChangeLog.d/make_assemble_changelog_enforce_line_length.txt @@ -0,0 +1,2 @@ +Changes + * Make assemble_changelog.py script enforce 80 character line limit diff --git a/scripts/assemble_changelog.py b/scripts/assemble_changelog.py index 02bae25b7..f85392c53 100755 --- a/scripts/assemble_changelog.py +++ b/scripts/assemble_changelog.py @@ -101,6 +101,9 @@ STANDARD_CATEGORIES = ( b'Changes', ) +# The maximum line length for an entry +MAX_LINE_LENGTH = 80 + CategoryContent = namedtuple('CategoryContent', [ 'name', 'title_line', # Title text and line number of the title 'body', 'body_line', # Body text and starting line number of the body @@ -241,6 +244,15 @@ class ChangeLog: line_offset + category.title_line, 'Unknown category: "{}"', category.name.decode('utf8')) + + body_split = category.body.splitlines() + for line in body_split: + if len(line) > MAX_LINE_LENGTH: + raise InputFormatError(filename, + line_offset + category.title_line, + 'Category body line too long: "{} ({})"', + category.name.decode('utf8'), len(line)) + self.categories[category.name] += category.body def __init__(self, input_stream, changelog_format):