-
-
Notifications
You must be signed in to change notification settings - Fork 26
Some code tools return "\r\n" on Windows. #130
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
Comments
Seems like a CRLF issue, |
I think Python-based tools have this problem. Reference: python/cpython#57328 我接下来用中文表达,英文不是太好。现代三大系统应该就 Windows 还在用 "\r" 了,现在的代码把工具输出的信息按 "\n" 分割后解析成行号列号消息等等,那么这个 "\r" 出现在消息之中是不是应该除了某些工具为了兼容 Windows 的命令行窗口之外没有什么用处。但可能某个 linter 检查代码时,发现代码中有触发什么 "\r" 规则,而返回了一行诊断信息中包含了 "\r" 的提示信息(不过这样的信息是不是也应该是已经转义的 |
I was hoping there is a generic function that would handle these platform dependent quirks, which would also fix other potential CRLF related issues 🤔 But if there isn't one maybe we could apply the monkey patch you described 👍 |
Ah, |
This is codespell diagnostic message:
These "^M" are "\r" characters, but not all code tools will use "\r\n" on Windows, maybe user should define a parse function to filter out these "^M"?
Tools without json output may have this issue on Windows, so guard can also fix it in
diag_fmt
function.guard.nvim/lua/guard/lint.lua
Line 95 in 4645785
or with an OS check if?
The text was updated successfully, but these errors were encountered: