Lombiq / .NET-Analyzers

.NET code analyzers and code convention settings for Lombiq projects.
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

IDE0055 false positive with LF line endings (OSOE-344) #71

Open sarahelsaig opened 2 years ago

sarahelsaig commented 2 years ago

This is our follow-up issue once https://github.com/dotnet/roslyn/issues/55526 is fixed.

What's the problem?

In Git repositories, it's common to use LF (\n, "Unix-style") line endings for better cross-platform compatibility (see https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/issues/65). The problem is that with .cs files, if we have LF line endings instead of CRLF (\r\n, "Windows-style") then roslyn will emit several false-positive IDE0055 warnings. There is a workaround of making only the .cs files CRLF as described in the above-linked issue. We have applied it to this repo and its submodules during OSOE-49.

What needs to be done?

Once the analyzer is fixed, the *.cs text eol=crlf rule should be removed from all .gitattributes files and then all .cs files should be renormalized to LF using the same steps described in the issue description of OSOE-91.

Jira issue

wAsnk commented 1 year ago

It just happened in https://github.com/Lombiq/Hosting-Media-Theme/pull/33