From d3ec6099ed027425f4cb17ca68b57be20b02ec7f Mon Sep 17 00:00:00 2001 From: Hawkynt Date: Fri, 4 Sep 2026 19:36:05 +0200 Subject: [PATCH] # the editorconfig asked for a 4-space indent this repository has never used The .editorconfig carried an override forcing a 4-space indent on C# and project files. That has never been this repository's style. Measured over its own source, ignoring vendored and generated files: opening brace on its own line 0 opening brace on the same line 4127 and the leading-space histogram has 22007 lines at two and 10186 at six, which only occur on a two-space ladder. The override is removed -- [*] already gives 2 -- and a [*.cs] block now states the K&R brace rules in the form Roslyn can actually enforce, which nothing did. --- .editorconfig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index b9c85d0..5bb846f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,8 +9,13 @@ trim_trailing_whitespace = true indent_style = space indent_size = 2 -[*.{cs,csproj,props,targets}] -indent_size = 4 +[*.cs] +# K&R: the opening brace ends the line that opens the block, and else/catch/finally +# continue the line that closed the previous one. Indentation is the 2 spaces from [*]. +csharp_new_line_before_open_brace = none +csharp_new_line_before_else = false +csharp_new_line_before_catch = false +csharp_new_line_before_finally = false [*.{md,markdown}] trim_trailing_whitespace = false # trailing spaces are hard line-breaks