Skip to content
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

SA1516: misfire in C# 9 top-level statements #3351

Closed
AArnott opened this issue Jun 15, 2021 · 11 comments · Fixed by #3482
Closed

SA1516: misfire in C# 9 top-level statements #3351

AArnott opened this issue Jun 15, 2021 · 11 comments · Fixed by #3482

Comments

@AArnott
Copy link
Contributor

AArnott commented Jun 15, 2021

Given this Program.cs file:

// Copyright (c) Andrew Arnott. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using MinerForeman;

var foreman = new Foreman();
await foreman.RunAsync();

The last line in the file above produces:

Warning	SA1516	Elements should be separated by blank line	Program.cs

This repros with StyleCop.Analyzers 1.2.0-beta.333

@thomaslevesque
Copy link

I'm seeing this as well. Apparently all top-level statements must be separated by a blank line, otherwise I have this warning.

What's weird is that the diagnostic doesn't report any file location... I have a warning, but I don't know where.

@sharwell
Copy link
Member

sharwell commented Feb 4, 2022

@thomaslevesque The reporting location bug is #3242, and should be fixed in newer releases.

@thomaslevesque
Copy link

@sharwell thanks. Yes, I probably need to update to a newer version.

@msmolka
Copy link

msmolka commented Mar 8, 2022

What is the status of this issue? do you know maybe in which pre-release it will be done? I'm using 1.2.0-beta.406 and still seeing issue on top=level statements

@sharwell
Copy link
Member

sharwell commented Mar 8, 2022

I don't believe anyone has submitted a fix for this issue yet.

@madhusameena
Copy link

Any comments on this ?
or any workaround for this ?

@maxkoshevoi
Copy link
Contributor

I don't believe anyone has submitted a fix for this issue yet.

@sharwell Created a fix: #3482

@maxkoshevoi
Copy link
Contributor

@sharwell Thanks for merging so quickly! Is there an ETA on next NuGet release?

@domagojmedo
Copy link

Still not fixed in 1.2.0-beta.406

@ultimaweapon
Copy link

That one is released before #3482 is merged.

@sharwell
Copy link
Member

sharwell commented May 3, 2022

Yep, waiting for a few more items to finish/merge and the next release should be soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants