-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Wrong IDE0055 in combination with CRLF, XML comment and preprocessor directive #73122
Comments
I am not able to reproduce this locally. I suspect this bug is reproducible due to the following:
Warning I do not recommend explicitly setting Note that this setup is different from the situation that led to this bug getting filed in the first place. The original issue appeared on a Windows CI system as part of sshnet/SSH.NET#1380. I left comments on that issue regarding the suspected root cause of those problems. |
@sharwell sorry, you are right, my repro only works on linux. I just tested it on windows and also can't reproduce it there. |
I have this same thing in YamlDotNet. It also manifests itself when you have comments in inline if statements like this: Not sure if that inline if issue is related to the same bug, but it only appears in Linux and enforcing CRLF (not sure on enforcing line feeds), which we needed to do because of all of the line ending inconsistencies from people developing on both Linux and Windows and/or developer preference settings, maybe even some editors that didn't respect editorconfig, which led to inconsistent line endings which at a minimum caused a lot of popups in Visual Studio when opening files with inconsistent line endings. |
@EdwardCooke that project unexpectedly sets the line ending for .cs files: https://github.com/aaubry/YamlDotNet/blob/485daaa7fa2a9fdc5863294ef580b880aac6a4df/.gitattributes#L2 The line file contents should be:
|
@sharwell thanks, I'll make that change and see what happens. What we found in the past is that if someone committed a change with LF line endings in the middle of the file, git checked in those line endings even though the rest of the file was CRLF. Which resulted in the inconsistent line endings. |
Version Used:
.NET SDK 8.0.204
Steps to Reproduce:
The following code will report IDE0055 on line 2, but only if the file has CRLF line endings:
The warning disappears if you either:
I created a repo with a reproduction: https://github.com/mus65/Ide0055Bug
dotnet build
reports:dotnet format Ide0055Bug.csproj whitespace --verify-no-changes
reports:this was noticed in sshnet/SSH.NET#1380
Diagnostic Id:
IDE0055
Expected Behavior:
no IDE0055 warning.
Actual Behavior:
IDE0055 warning.
The text was updated successfully, but these errors were encountered: