Repository navigation
Keep the blank lines the author wrote unless asked to remove them - #375
Merged
Merged
Conversation
dotnet format removes and collapses no blank line. Curb capped runs at one and stripped blank lines inside braces and at the start of a file. The defaults of csharp_keep_blank_lines_in_declarations/_in_code are now unlimited, and csharp_remove_blank_lines_near_braces_in_declarations/_in_code are false, so the blank lines above a closing brace and at the start of a file stay too. The previous behaviour is one editorconfig away. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With no blank-line keys set, Curb collapsed runs of blank lines and removed the ones inside braces and at the start of a file, which
dotnet format whitespaceleaves alone (#368).What
csharp_keep_blank_lines_in_declarationsandcsharp_keep_blank_lines_in_codedefault to unlimited (were 1).csharp_remove_blank_lines_near_braces_in_declarationsand_in_codedefault to false (were true).csharp_blank_lines_around_local_methoddoes not add a blank line under an opening brace.keep = 1andremove_near_braces = true; the tests of it set both throughLegacyBlankLines. Several*_by_defaulttests are renamed*_when_asked.Behaviour change: output for repositories with no blank-line keys moves (blank lines now stay). Breaking for 0.x, so the next release is 0.16.0.
Verify
Every_blank_line_the_author_wrote_is_kept_by_defaultis Default blank-line settings remove blank lines dotnet format keeps #368's input, unchanged../build.sh verifyexpectationspasses;curb check src tools testsreports nothing to change;./build.sh optionsregenerated the docs.dotnet format whitespace: 98.72% (2089/2116), above the ~90% floor.Closes #368
🤖 Generated with Claude Code