SA1518 - The line endings at the end of a file do not match the setti…#7571
SA1518 - The line endings at the end of a file do not match the setti…#7571Forgind merged 3 commits intodotnet:mainfrom
Conversation
…ngs for the project.
…ngs for the project.
| } | ||
| } | ||
| } No newline at end of file | ||
| } |
There was a problem hiding this comment.
SA 1518 even applies to newlines at the end of files? I'm not (personally) opposed to taking those out, but I imagine they'd come back in with various editors so probably not worth worrying about. Removing multiple blank lines at the end of a file seems more clear-cut to me.
There was a problem hiding this comment.
The analyser uses the editor config settings for new lines. So I don't think they will get overridden by the editor later unless the settings change.
|
This only affects the |
The analyser has been applied to the whole solution. |
|
No, only C# files have been touched. |
This issue is specific to the stylecop analyser. I ran the specific analyser fix all for the solution. It only works against .net code and not anything else. Its not a solution wide analyser for all files. |
|
That clears it up. I have a PR that touches the XAML, Props and Targets files. I was looking to see if I should rebase on top of yours but yours doesn't touch those files. So, no need. |
|
can you link it here? Are you using an Analyser so they don't sneak back in? |
|
#7168 and no, I don't think there's an analyzer for these files. |
rainersigwald
left a comment
There was a problem hiding this comment.
LGTM. Is the reason we can't enable the rule the Roslyn source package again?
|
It is not desirable for Microsoft.CodeAnalysis.Collections to omit the trailing newline, so feel free to send a Roslyn PR to just fix those two cases. |
|
Thanks everyone! |
|
Rolsyn files have been fixed. Awaiting a release and msbuild to update before we enable the rule. |
Relates to #7174
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1518.md
The two remaining warnings/suggestions are from
RoslynImmutableInterlockedpulled in fromMicrosoft.CodeAnalysis.CollectionsinMicrosoft.Build.Framework.Solution for the warnings from the nuget package is outlined in dotnet/roslyn#55992