From 3e7f8952fc9f2c23feae80c068685d1a4a7d8875 Mon Sep 17 00:00:00 2001 From: Mark Lauter <10211200+marklauter@users.noreply.github.com> Date: Tue, 14 Jul 2026 17:23:36 -0400 Subject: [PATCH] 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) --- .editorconfig | 74 +++++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 52 deletions(-) diff --git a/.editorconfig b/.editorconfig index 546bdcc..d8e3973 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,56 +12,16 @@ indent_style = space tab_width = 4 # New line preferences -end_of_line = crlf +end_of_line = lf insert_final_newline = true #### .NET Coding Conventions #### -# Organize usings -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = false - -# this. and Me. preferences -dotnet_style_qualification_for_event = true:suggestion -dotnet_style_qualification_for_field = true:suggestion -dotnet_style_qualification_for_method = true:suggestion -dotnet_style_qualification_for_property = true:suggestion - -# Language keywords vs BCL types preferences -dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion -dotnet_style_predefined_type_for_member_access = false:suggestion - -# Parentheses preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent -dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent -dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent - -# Modifier preferences -dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent - -# Expression-level preferences +# C#-only expression preferences. Language-agnostic dotnet_style_* / dotnet_code_quality_* / +# dotnet_style_parentheses_* live under [*.{cs,vb}] below — do not re-declare them here. csharp_style_deconstructed_variable_declaration = true:suggestion csharp_style_inlined_variable_declaration = true:suggestion csharp_style_throw_expression = true:suggestion -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_collection_initializer = true:suggestion -dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_object_initializer = true:suggestion -dotnet_style_prefer_auto_properties = true:suggestion -dotnet_style_prefer_compound_assignment = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion -dotnet_style_prefer_conditional_expression_over_return = true:suggestion -dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion -dotnet_style_prefer_inferred_tuple_names = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion - -# Field preferences -dotnet_style_readonly_field = true:warning - -# Parameter preferences -dotnet_code_quality_unused_parameters = all:warning #### C# Coding Conventions #### @@ -72,11 +32,11 @@ csharp_style_var_when_type_is_apparent = true:suggestion # Expression-bodied members csharp_style_expression_bodied_accessors = true:suggestion -csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_constructors = true:suggestion csharp_style_expression_bodied_indexers = true:suggestion csharp_style_expression_bodied_lambdas = true:suggestion csharp_style_expression_bodied_local_functions = true:suggestion -csharp_style_expression_bodied_methods = true:silent +csharp_style_expression_bodied_methods = true:suggestion csharp_style_expression_bodied_operators = true:suggestion csharp_style_expression_bodied_properties = true:suggestion @@ -90,15 +50,17 @@ csharp_style_conditional_delegate_call = true:suggestion # Modifier preferences csharp_prefer_static_local_function = true:suggestion -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async +csharp_prefer_system_threading_lock = true:suggestion +csharp_prefer_static_anonymous_function = true:suggestion +csharp_style_prefer_unbound_generic_type_in_nameof = true:suggestion +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async # Code-block preferences -csharp_prefer_braces = true:suggestion +csharp_prefer_braces = false:suggestion csharp_prefer_simple_using_statement = true:warning # Expression-level preferences csharp_prefer_simple_default_expression = true:suggestion -csharp_style_pattern_local_over_anonymous_function = true:suggestion csharp_style_prefer_index_operator = true:suggestion csharp_style_prefer_range_operator = true:suggestion csharp_style_unused_value_assignment_preference = discard_variable:suggestion @@ -253,7 +215,7 @@ dotnet_naming_style.camelcase.required_prefix = dotnet_naming_style.camelcase.required_suffix = dotnet_naming_style.camelcase.word_separator = dotnet_naming_style.camelcase.capitalization = camel_case -csharp_style_namespace_declarations = block_scoped:silent +csharp_style_namespace_declarations = file_scoped:warning csharp_style_prefer_method_group_conversion = true:silent csharp_style_prefer_top_level_statements = true:silent csharp_style_prefer_null_check_over_type_check = true:suggestion @@ -319,7 +281,7 @@ dotnet_diagnostic.IDE1006.severity = suggestion dotnet_diagnostic.IDE2000.severity = suggestion dotnet_diagnostic.IDE2002.severity = suggestion dotnet_diagnostic.IDE2004.severity = suggestion -csharp_style_prefer_local_over_anonymous_function = true:suggestion +csharp_style_prefer_local_over_anonymous_function = false:suggestion csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion csharp_style_prefer_primary_constructors = true:suggestion csharp_style_prefer_tuple_swap = true:suggestion @@ -356,7 +318,7 @@ dotnet_diagnostic.IDE2006.severity = suggestion dotnet_style_operator_placement_when_wrapping = beginning_of_line tab_width = 4 indent_size = 4 -end_of_line = crlf +end_of_line = lf dotnet_style_coalesce_expression = true:suggestion dotnet_style_null_propagation = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion @@ -372,6 +334,14 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_compound_assignment = true:suggestion dotnet_style_prefer_simplified_interpolation = true:suggestion dotnet_style_namespace_match_folder = true:suggestion +# Organize usings (dotnet_* — relocated here from [*.cs]) +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false +# Added 2026 — present in the current .NET default, previously absent +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_non_hidden_explicit_cast_in_source = true +dotnet_prefer_system_hash_code = true +dotnet_remove_unnecessary_suppression_exclusions = none dotnet_diagnostic.CA1000.severity = suggestion dotnet_diagnostic.CA1010.severity = suggestion dotnet_diagnostic.CA1036.severity = suggestion @@ -399,7 +369,7 @@ dotnet_style_qualification_for_event = false:suggestion dotnet_style_prefer_collection_expression = true:suggestion dotnet_style_readonly_field = true:error dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion -dotnet_style_predefined_type_for_member_access = false:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion dotnet_style_allow_statement_immediately_after_block_experimental = false:suggestion dotnet_style_allow_multiple_blank_lines_experimental = false:suggestion