mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Make assemble changelog script enforce line length
As I descovered, a changelog entry with a line length greater than 80 characters would still pass CI. This is a quick change to the script to make it detect these descrepancies and fail. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
		
							parent
							
								
									477a463684
								
							
						
					
					
						commit
						f08648d2da
					
				@ -0,0 +1,2 @@
 | 
			
		||||
Changes
 | 
			
		||||
   * Make assemble_changelog.py script enforce 80 character line limit
 | 
			
		||||
@ -74,6 +74,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
 | 
			
		||||
@ -214,6 +217,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):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user