Allow patch files to have trailing whitespace

An unchanged blank line results in a line containing a single space in the
diff.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2025-09-12 21:59:31 +02:00
parent 088a99ee20
commit 581da21d7b
+1 -1
View File
@@ -310,7 +310,7 @@ class TrailingWhitespaceIssueTracker(LineIssueTracker):
"""Track lines with trailing whitespace."""
heading = "Trailing whitespace:"
suffix_exemptions = frozenset([".dsp", ".md"])
suffix_exemptions = frozenset([".diff", ".dsp", ".md", ".patch"])
def issue_with_line(self, line, _filepath, _line_number):
return line.rstrip(b"\r\n") != line.rstrip()