mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 22:25:47 +01:00
In Windows files, detect CR without LF as well as LF without CR
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
0d5b016709
commit
368ccd416b
@ -140,7 +140,7 @@ class UnixLineEndingIssueTracker(LineIssueTracker):
|
|||||||
|
|
||||||
|
|
||||||
class WindowsLineEndingIssueTracker(LineIssueTracker):
|
class WindowsLineEndingIssueTracker(LineIssueTracker):
|
||||||
"""Track files with non-Windows line endings (i.e. files without CR)."""
|
"""Track files with non-Windows line endings (i.e. CR or LF not in CRLF)."""
|
||||||
|
|
||||||
heading = "Non-Windows line endings:"
|
heading = "Non-Windows line endings:"
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ class WindowsLineEndingIssueTracker(LineIssueTracker):
|
|||||||
return is_windows_file(filepath)
|
return is_windows_file(filepath)
|
||||||
|
|
||||||
def issue_with_line(self, line, _filepath):
|
def issue_with_line(self, line, _filepath):
|
||||||
return not line.endswith(b"\r\n")
|
return not line.endswith(b"\r\n") or b"\r" in line[:-2]
|
||||||
|
|
||||||
|
|
||||||
class TrailingWhitespaceIssueTracker(LineIssueTracker):
|
class TrailingWhitespaceIssueTracker(LineIssueTracker):
|
||||||
|
Loading…
Reference in New Issue
Block a user