Skip to content

Commit 89fcfe5

Browse files
marklauterclaude
andauthored
Adopt canonical .editorconfig from scaffolding-csharp template (#31)
* Adopt canonical .editorconfig from scaffolding-csharp template Replace the repo's .editorconfig with the canonical version from the scaffolding-csharp skill template so a repo scaffolded today and one that predates the template are indistinguishable at the style layer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Expression-body static ctor to satisfy IDE0021 The canonical .editorconfig sets csharp_style_expression_bodied_constructors, which CI's format job enforces at --severity info. This was the only violation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 155b387 commit 89fcfe5

2 files changed

Lines changed: 20 additions & 53 deletions

File tree

.editorconfig

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,11 @@ insert_final_newline = true
1717

1818
#### .NET Coding Conventions ####
1919

20-
# Organize usings
21-
dotnet_separate_import_directive_groups = false
22-
dotnet_sort_system_directives_first = false
23-
24-
# this. and Me. preferences
25-
dotnet_style_qualification_for_event = true:suggestion
26-
dotnet_style_qualification_for_field = true:suggestion
27-
dotnet_style_qualification_for_method = true:suggestion
28-
dotnet_style_qualification_for_property = true:suggestion
29-
30-
# Language keywords vs BCL types preferences
31-
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
32-
dotnet_style_predefined_type_for_member_access = true:suggestion
33-
34-
# Parentheses preferences
35-
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
36-
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent
37-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
38-
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent
39-
40-
# Modifier preferences
41-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
42-
43-
# Expression-level preferences
20+
# C#-only expression preferences. Language-agnostic dotnet_style_* / dotnet_code_quality_* /
21+
# dotnet_style_parentheses_* live under [*.{cs,vb}] below — do not re-declare them here.
4422
csharp_style_deconstructed_variable_declaration = true:suggestion
4523
csharp_style_inlined_variable_declaration = true:suggestion
4624
csharp_style_throw_expression = true:suggestion
47-
dotnet_style_coalesce_expression = true:suggestion
48-
dotnet_style_collection_initializer = true:suggestion
49-
dotnet_style_explicit_tuple_names = true:suggestion
50-
dotnet_style_null_propagation = true:suggestion
51-
dotnet_style_object_initializer = true:suggestion
52-
dotnet_style_prefer_auto_properties = true:suggestion
53-
dotnet_style_prefer_compound_assignment = true:suggestion
54-
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
55-
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
56-
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
57-
dotnet_style_prefer_inferred_tuple_names = true:suggestion
58-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
59-
60-
# Field preferences
61-
dotnet_style_readonly_field = true:warning
62-
63-
# Parameter preferences
64-
dotnet_code_quality_unused_parameters = all:warning
6525

6626
#### C# Coding Conventions ####
6727

@@ -72,11 +32,11 @@ csharp_style_var_when_type_is_apparent = true:suggestion
7232

7333
# Expression-bodied members
7434
csharp_style_expression_bodied_accessors = true:suggestion
75-
csharp_style_expression_bodied_constructors = false:silent
35+
csharp_style_expression_bodied_constructors = true:suggestion
7636
csharp_style_expression_bodied_indexers = true:suggestion
7737
csharp_style_expression_bodied_lambdas = true:suggestion
7838
csharp_style_expression_bodied_local_functions = true:suggestion
79-
csharp_style_expression_bodied_methods = true:silent
39+
csharp_style_expression_bodied_methods = true:suggestion
8040
csharp_style_expression_bodied_operators = true:suggestion
8141
csharp_style_expression_bodied_properties = true:suggestion
8242

@@ -90,15 +50,17 @@ csharp_style_conditional_delegate_call = true:suggestion
9050

9151
# Modifier preferences
9252
csharp_prefer_static_local_function = true:suggestion
93-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
53+
csharp_prefer_system_threading_lock = true:suggestion
54+
csharp_prefer_static_anonymous_function = true:suggestion
55+
csharp_style_prefer_unbound_generic_type_in_nameof = true:suggestion
56+
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
9457

9558
# Code-block preferences
96-
csharp_prefer_braces = true:suggestion
59+
csharp_prefer_braces = false:suggestion
9760
csharp_prefer_simple_using_statement = true:warning
9861

9962
# Expression-level preferences
10063
csharp_prefer_simple_default_expression = true:suggestion
101-
csharp_style_pattern_local_over_anonymous_function = true:suggestion
10264
csharp_style_prefer_index_operator = true:suggestion
10365
csharp_style_prefer_range_operator = true:suggestion
10466
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
@@ -253,7 +215,7 @@ dotnet_naming_style.camelcase.required_prefix =
253215
dotnet_naming_style.camelcase.required_suffix =
254216
dotnet_naming_style.camelcase.word_separator =
255217
dotnet_naming_style.camelcase.capitalization = camel_case
256-
csharp_style_namespace_declarations = block_scoped:silent
218+
csharp_style_namespace_declarations = file_scoped:warning
257219
csharp_style_prefer_method_group_conversion = true:silent
258220
csharp_style_prefer_top_level_statements = true:silent
259221
csharp_style_prefer_null_check_over_type_check = true:suggestion
@@ -319,7 +281,7 @@ dotnet_diagnostic.IDE1006.severity = suggestion
319281
dotnet_diagnostic.IDE2000.severity = suggestion
320282
dotnet_diagnostic.IDE2002.severity = suggestion
321283
dotnet_diagnostic.IDE2004.severity = suggestion
322-
csharp_style_prefer_local_over_anonymous_function = false:silent
284+
csharp_style_prefer_local_over_anonymous_function = false:suggestion
323285
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
324286
csharp_style_prefer_primary_constructors = true:suggestion
325287
csharp_style_prefer_tuple_swap = true:suggestion
@@ -372,6 +334,14 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
372334
dotnet_style_prefer_compound_assignment = true:suggestion
373335
dotnet_style_prefer_simplified_interpolation = true:suggestion
374336
dotnet_style_namespace_match_folder = true:suggestion
337+
# Organize usings (dotnet_* — relocated here from [*.cs])
338+
dotnet_separate_import_directive_groups = false
339+
dotnet_sort_system_directives_first = false
340+
# Added 2026 — present in the current .NET default, previously absent
341+
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
342+
dotnet_style_prefer_non_hidden_explicit_cast_in_source = true
343+
dotnet_prefer_system_hash_code = true
344+
dotnet_remove_unnecessary_suppression_exclusions = none
375345
dotnet_diagnostic.CA1000.severity = suggestion
376346
dotnet_diagnostic.CA1010.severity = suggestion
377347
dotnet_diagnostic.CA1036.severity = suggestion

tests/Plumber.Tests/PlumberTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,10 +1124,7 @@ private sealed class BuildCounterMiddleware(RequestMiddleware<string, string> ne
11241124
{
11251125
public static int Constructions;
11261126

1127-
static BuildCounterMiddleware()
1128-
{
1129-
Constructions = 0;
1130-
}
1127+
static BuildCounterMiddleware() => Constructions = 0;
11311128

11321129
private readonly RequestMiddleware<string, string> next = ConstructionTracker(next);
11331130

0 commit comments

Comments
 (0)