Skip to content

Commit c544e22

Browse files
authored
Apply new-lines check to all lines of a file, not just the first one
fixes adrienverge#475
1 parent 95e17b3 commit c544e22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yamllint/rules/new_lines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def check(conf, line):
5151
elif conf['type'] == 'dos':
5252
newline_char = '\r\n'
5353

54-
if line.start == 0 and len(line.buffer) > line.end:
54+
if len(line.buffer) > line.end:
5555
if line.buffer[line.end:line.end + len(newline_char)] != newline_char:
5656
c = repr(newline_char).strip('\'')
57-
yield LintProblem(1, line.end - line.start + 1,
57+
yield LintProblem(line.line_no, line.end - line.start + 1,
5858
f'wrong new line character: expected {c}')

0 commit comments

Comments
 (0)