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

CSharpier keeps adding a newline every time a file is formatted #1408

Closed
bvanreeven opened this issue Dec 20, 2024 · 1 comment · Fixed by #1409
Closed

CSharpier keeps adding a newline every time a file is formatted #1408

bvanreeven opened this issue Dec 20, 2024 · 1 comment · Fixed by #1409
Milestone

Comments

@bvanreeven
Copy link

Input:

Given the following, already correctly formatted, C# file:

using System;

namespace MyCompany.MyNamespace;

// Comment block

Running CSharpier (v0.30.3) on the file (with the --no-cache flag) will add a newline between the namespace and the comment block every time the file is formatted.

Also, running CSharpier with the --check flag will mark the file as having a formatting issue.

Output:

  • A newline is added to the file every time it is formatted.

Expected behavior:

  • The file remains formatted the same way, even when running CSharpier multiple times.
@belav
Copy link
Owner

belav commented Dec 20, 2024

I remember taking a look at this awhile back after running into it somehow and thinking "this won't ever come up in the real world" when I couldn't find an obvious fix. I'll take another look at it

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

Successfully merging a pull request may close this issue.

2 participants