Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display valid message when using CRLF #691

Open
sahitkumarreddy opened this issue Oct 7, 2024 · 1 comment
Open

Display valid message when using CRLF #691

sahitkumarreddy opened this issue Oct 7, 2024 · 1 comment

Comments

@sahitkumarreddy
Copy link

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) ?

@adrienverge
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants