mirror of
				https://github.com/Mbed-TLS/mbedtls.git
				synced 2025-11-03 20:33:16 +03:00 
			
		
		
		
	Check that Windows files have Windows line endings
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
		@@ -139,6 +139,18 @@ class UnixLineEndingIssueTracker(LineIssueTracker):
 | 
				
			|||||||
        return b"\r" in line
 | 
					        return b"\r" in line
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class WindowsLineEndingIssueTracker(LineIssueTracker):
 | 
				
			||||||
 | 
					    """Track files with non-Windows line endings (i.e. files without CR)."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    heading = "Non-Windows line endings:"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def should_check_file(self, filepath):
 | 
				
			||||||
 | 
					        return is_windows_file(filepath)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def issue_with_line(self, line, _filepath):
 | 
				
			||||||
 | 
					        return not line.endswith(b"\r\n")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TrailingWhitespaceIssueTracker(LineIssueTracker):
 | 
					class TrailingWhitespaceIssueTracker(LineIssueTracker):
 | 
				
			||||||
    """Track lines with trailing whitespace."""
 | 
					    """Track lines with trailing whitespace."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -222,6 +234,7 @@ class IntegrityChecker(object):
 | 
				
			|||||||
            EndOfFileNewlineIssueTracker(),
 | 
					            EndOfFileNewlineIssueTracker(),
 | 
				
			||||||
            Utf8BomIssueTracker(),
 | 
					            Utf8BomIssueTracker(),
 | 
				
			||||||
            UnixLineEndingIssueTracker(),
 | 
					            UnixLineEndingIssueTracker(),
 | 
				
			||||||
 | 
					            WindowsLineEndingIssueTracker(),
 | 
				
			||||||
            TrailingWhitespaceIssueTracker(),
 | 
					            TrailingWhitespaceIssueTracker(),
 | 
				
			||||||
            TabIssueTracker(),
 | 
					            TabIssueTracker(),
 | 
				
			||||||
            MergeArtifactIssueTracker(),
 | 
					            MergeArtifactIssueTracker(),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user