Skip to content

Commit 0964d86

Browse files
committed
Update .editorconfig for C# coding style improvements
- Added preferences for static anonymous functions, static local functions, and system threading locks. - Introduced experimental settings for blank lines in various contexts. - Adjusted unused parameters handling to be non-public by default. - Updated naming rules for interfaces and non-field members. - Modified severity levels and namespace declaration scopes. - Aims to enhance code readability and maintainability through consistent styling.
1 parent 0cbcc86 commit 0964d86

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

.editorconfig

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ csharp_new_line_between_query_expression_clauses = true
2626
csharp_prefer_braces = when_multiline:suggestion
2727
csharp_prefer_simple_default_expression = true:suggestion
2828
csharp_prefer_simple_using_statement = true:suggestion
29+
csharp_prefer_static_anonymous_function = true:suggestion
30+
csharp_prefer_static_local_function = true:suggestion
31+
csharp_prefer_system_threading_lock = true:suggestion
2932
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:suggestion
3033
csharp_preserve_single_line_blocks = true
3134
csharp_preserve_single_line_statements = true
@@ -40,6 +43,11 @@ csharp_space_between_method_call_parameter_list_parentheses = false
4043
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
4144
csharp_space_between_method_declaration_parameter_list_parentheses = false
4245
csharp_space_between_parentheses = false
46+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
47+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
48+
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
49+
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
50+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
4351
csharp_style_conditional_delegate_call = true:suggestion
4452
csharp_style_deconstructed_variable_declaration = true:suggestion
4553
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
@@ -50,32 +58,40 @@ csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
5058
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
5159
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
5260
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
61+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
5362
csharp_style_inlined_variable_declaration = true:suggestion
63+
csharp_style_namespace_declarations = file_scoped:suggestion
5464
csharp_style_pattern_local_over_anonymous_function = true:suggestion
5565
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
5666
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
67+
csharp_style_prefer_extended_property_pattern = true:suggestion
68+
csharp_style_prefer_implicitly_typed_lambda_expression = true:suggestion
5769
csharp_style_prefer_index_operator = true:suggestion
70+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
71+
csharp_style_prefer_method_group_conversion = true:suggestion
5872
csharp_style_prefer_not_pattern = true:suggestion
73+
csharp_style_prefer_null_check_over_type_check = true:suggestion
5974
csharp_style_prefer_pattern_matching = true:suggestion
75+
csharp_style_prefer_primary_constructors = true:suggestion
6076
csharp_style_prefer_range_operator = true:suggestion
77+
csharp_style_prefer_readonly_struct = true:suggestion
78+
csharp_style_prefer_readonly_struct_member = true:suggestion
6179
csharp_style_prefer_switch_expression = true:suggestion
80+
csharp_style_prefer_top_level_statements = true:suggestion
81+
csharp_style_prefer_tuple_swap = true:suggestion
82+
csharp_style_prefer_unbound_generic_type_in_nameof = true:suggestion
83+
csharp_style_prefer_utf8_string_literals = true:suggestion
6284
csharp_style_throw_expression = true:suggestion
6385
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
6486
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
6587
csharp_style_var_elsewhere = true:suggestion
6688
csharp_style_var_for_built_in_types = true:suggestion
6789
csharp_style_var_when_type_is_apparent = true:suggestion
68-
csharp_using_directive_placement = inside_namespace:suggestion
69-
csharp_style_namespace_declarations = block_scoped:silent
70-
csharp_style_prefer_method_group_conversion = true:silent
71-
csharp_style_prefer_top_level_statements = true:silent
72-
csharp_style_prefer_primary_constructors = true:suggestion
73-
csharp_prefer_system_threading_lock = true:suggestion
74-
csharp_style_prefer_null_check_over_type_check = true:suggestion
90+
csharp_using_directive_placement = outside_namespace:suggestion
7591

7692
[*.{cs,vb}]
7793
dotnet_analyzer_diagnostic.severity = suggestion
78-
dotnet_code_quality_unused_parameters = non_public
94+
dotnet_code_quality_unused_parameters = non_public:suggestion
7995
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
8096
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
8197
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
@@ -104,6 +120,8 @@ dotnet_naming_symbols.types.applicable_accessibilities = public, internal, priva
104120
dotnet_naming_symbols.types.required_modifiers =
105121
dotnet_separate_import_directive_groups = true
106122
dotnet_sort_system_directives_first = false
123+
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
124+
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
107125
dotnet_style_coalesce_expression = true:suggestion
108126
dotnet_style_collection_initializer = true:suggestion
109127
dotnet_style_explicit_tuple_names = true:suggestion

0 commit comments

Comments
 (0)