-
Notifications
You must be signed in to change notification settings - Fork 287
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
False positive on package comment is detached
lint on CRLF ended files
#607
Comments
Line 33 in 2c895fb
|
|
Is this still relevant? The issue seems fixed and we're using the latest parser. |
This can still be reproduced with the latest version (
The issue upstream was not fixed by fixing the parser, but by applying a workaround on gopls. The solution would be to apply the same workaround here. |
Describe the bug
revive
will incorrectly reportpackage comment is detached
on CRLF ended files. This is likely related to golang/go#41197.To Reproduce
Steps to reproduce the behavior:
go get -u github.com/mgechev/revive
main.go
file with the following content:sed -e $'s/$/\r/' main.go > main_crlf.go
)file main_crlf.go
should sayASCII text, with CRLF line terminators
andcat -v main_crlf.go
should show^M
control codes at the end of lines).revive main_crlf.go
.Expected behavior
revive
should not report anything for that file (i.e. it should have the same behavior as if I skipped steps 3-4).Logs
revive
output isDesktop (please complete the following information):
Additional context
The Go team deemed the issue above unfixable in the parser side because of backwards-compatibility concerns (see golang/go@a14e7bf). This does not mean the bug is unfixable on
revive
, but the solution may be a bit more cumbersome.The text was updated successfully, but these errors were encountered: