-
-
Notifications
You must be signed in to change notification settings - Fork 99
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 strips intentional empty lines between using
groups
#1305
Comments
I had intended to keep existing blank lines between usings when implementing sorting but it proved difficult and didn't seem worth the effort. I'd be happy to add that feature to the backlog but is is unlikely to be implemented any time soon. Otherwise I suggest turning off |
If it's too hard to enable empty line separation between using directive groups, I'd be perfectly happy to just turn off using sorting in CSharpier. It took quite a while to even figure out what my issue was, because the sorting added in 0.26.0 isn't mentioned anywhere in the docs that I could see—I had to read through the release notes until I found it. This feels like a feature that should really be configurable, or at least explicitly mentioned in the docs as a non-configurable default behavior. |
I was thinking it might be possible to just check how Roslyn handles breaking up using groups when |
I'm upgrading a project from .NET 6 to 8, and also CSharpier as part of that. Previously, we sorted using directives with
dotnet format style
and thedotnet_separate_import_directive_groups
option in.editorconfig
set totrue
.Since upgrading from
0.25.0
to0.28.2
, I see that CSharpier also now supports sortingusing
. But, it is not configurable. It does not respect thedotnet_separate_import_directive_groups
setting, and keeps trying to strip out the empty lines between using groups that we intentionally kept for clarity. This change in default behavior is causing our git hooks and our CI/CD to fail, since CSharpier anddotnet format style
now create conflicting outputs.Input:
Output:
Expected behavior:
The text was updated successfully, but these errors were encountered: