adrienverge/yamllint

Display valid message when using CRLF

Opened this issue · 1 comments

The current error message when a file has line separator as CRLF instead of LF, is

"1:11 error wrong new line character: expected \n (new-lines)".

Can we update to a more informative message which can print, the issue is because of using wrong line separator(CRLF) ?

Hello,

Indeed, we could print something more informative, e.g.

# before
  1:11      error    wrong new line character: expected \n  (new-lines)
# after
  1:11      error    wrong new line character: expected "\n", found "\r\n"  (new-lines)

Contributions are welcome! The change would be in yamllint/rules/new_lines.py + non-regression tests in tests/rules/test_new_lines.py.