From af843b675a0f89962ffedc3241073a5954e77d93 Mon Sep 17 00:00:00 2001 From: Jan Wille Date: Mon, 20 Jun 2022 19:29:34 +0200 Subject: [PATCH] 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 --- yamllint/rules/new_lines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yamllint/rules/new_lines.py b/yamllint/rules/new_lines.py index 6dbd180..fc3d399 100644 --- a/yamllint/rules/new_lines.py +++ b/yamllint/rules/new_lines.py @@ -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')