From 7e4152311a0b185b37f5b812e247a9ad6fa2609a Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 5 Oct 2022 16:19:16 +1100 Subject: [PATCH] Add a few more things to create a baseline .editorconfig --- .editorconfig | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index e509f668de..269aae0dcc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -39,6 +39,9 @@ insert_final_newline = true dotnet_sort_system_directives_first = true dotnet_separate_import_directive_groups = false +# IDE0005 - Remove unnecessary imports +dotnet_diagnostic.IDE0005.severity = suggestion + # IDE0046: If expression can be simplified dotnet_style_prefer_conditional_expression_over_return = false:silent @@ -88,7 +91,7 @@ dotnet_style_allow_statement_immediately_after_block_experimental = false:warnin csharp_style_unused_value_expression_statement_preference = discard_variable:none # IDE0065 -csharp_using_directive_placement = outside_namespace +csharp_using_directive_placement = outside_namespace:suggestion # xUnit1004: Test methods should not be skipped dotnet_diagnostic.xUnit1004.severity = refactoring @@ -176,3 +179,33 @@ dotnet_naming_style.pascal_case_style.capitalization = pascal_case # VSTHRD100: Avoid async void methods dotnet_diagnostic.VSTHRD100.severity = warning dotnet_diagnostic.VSTHRD101.severity = warning + +# Various settings that may not indicate desired style, but codify existing style +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = block_scoped:suggestion +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_indent_labels = one_less_than_current +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = false:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_compound_assignment = true:suggestion