new-lines: explicitly check \n for type: unix

To be more consistent with the other types, unix now also checks against
the expected newline character (`\n`) instead of checking if a wrong
character (`\r`) is present
This commit is contained in:
Jan Wille 2022-06-20 19:29:34 +02:00 committed by Adrien Vergé
parent 695fc5f1f1
commit af843b675a

View File

@ -48,6 +48,6 @@ def check(conf, line):
yield LintProblem(1, line.end - line.start + 1,
'wrong new line character: expected \\r\\n')
else:
if line.buffer[line.end] == '\r':
if line.buffer[line.end] != '\n':
yield LintProblem(1, line.end - line.start + 1,
'wrong new line character: expected \\n')