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

A namespace with assembly attribute and using causes two newlines #551

Closed
lara-ec opened this issue Jan 19, 2022 · 1 comment · Fixed by #556
Closed

A namespace with assembly attribute and using causes two newlines #551

lara-ec opened this issue Jan 19, 2022 · 1 comment · Fixed by #556
Assignees
Milestone

Comments

@lara-ec
Copy link

lara-ec commented Jan 19, 2022

Hi, since version 0.13.0, csharpier uses two newlines in the following code:

Original:

using Microsoft.Azure.Functions.Extensions.DependencyInjection;

[assembly: FunctionsStartup(typeof(Test.Startup))]

namespace Test { }

After formatting:

using Microsoft.Azure.Functions.Extensions.DependencyInjection;

[assembly: FunctionsStartup(typeof(Test.Startup))]


namespace Test { }

In my opinion the original is correctly formatted.

Interestingly enough, the following code doesn't have that issue:

[assembly: Microsoft.Azure.Functions.Extensions.DependencyInjection.FunctionsStartup(
    typeof(Test.Startup)
)]

namespace Test { }
@belav
Copy link
Owner

belav commented Jan 20, 2022

Another edge case I just ran into that is related, a double line is added before the #endif

using System;
#if SIGN2048
using System.Reflection;
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile(@"internalsvisibleto-2048.snk")]

#endif

namespace InternalsVisibleTo { }

@belav belav self-assigned this Jan 20, 2022
@belav belav added this to the 0.14.0 milestone Jan 20, 2022
belav added a commit that referenced this issue Jan 20, 2022
shocklateboy92 pushed a commit that referenced this issue Jan 21, 2022
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.

2 participants