diff --git a/yamllint/rules/new_lines.py b/yamllint/rules/new_lines.py index 2ee5512a..d7de80b2 100644 --- a/yamllint/rules/new_lines.py +++ b/yamllint/rules/new_lines.py @@ -51,8 +51,8 @@ def check(conf, line): elif conf['type'] == 'dos': newline_char = '\r\n' - if line.start == 0 and len(line.buffer) > line.end: + if len(line.buffer) > line.end: if line.buffer[line.end:line.end + len(newline_char)] != newline_char: c = repr(newline_char).strip('\'') - yield LintProblem(1, line.end - line.start + 1, + yield LintProblem(line.line_no, line.end - line.start + 1, f'wrong new line character: expected {c}')