Last active
February 19, 2024 14:13
-
-
Save FaronBracy/155d8d7ad98b4ceeb526b9f47543db1b to your computer and use it in GitHub Desktop.
Editor config file for CSharp .cs files including Visual Studio and ReSharper custom attributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################################################################################### | |
# 2019-01-15 Initial Creation | |
# 2019-04-01 Added ReSharper Settings | |
# 2019-05-16 Naming Rules Work With ReSharper | |
# 2019-07-09 Constant and Static Readonly Naming Rules | |
# 2022-09-16 New Settings for Visual Studio 2022 | |
##################################################################################################### | |
# Based off of generic config from https://github.com/RehanSaeed/EditorConfig | |
# License MIT - https://github.com/RehanSaeed/EditorConfig/blob/master/LICENSE | |
# | |
# Also based off of config from dotnet/cli - https://github.com/dotnet/cli/blob/master/.editorconfig | |
# License MIT - https://github.com/dotnet/cli/blob/master/LICENSE | |
# | |
# Compared against editorconfig generated using Visual Studio Intellicode extension | |
##################################################################################################### | |
################# | |
# Common Settings | |
################# | |
# This file is the top-most EditorConfig file | |
root = true | |
# All Files | |
[*] | |
indent_style = space | |
indent_size = 3 | |
insert_final_newline = false | |
trim_trailing_whitespace = true | |
tab_width = 3 | |
end_of_line = crlf | |
########################### | |
# .NET Language Conventions | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions | |
########################### | |
# .NET Code Style Settings | |
# Avoid "this." unless absolutely necessary | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#this_and_me | |
dotnet_style_qualification_for_field = false:suggestion | |
dotnet_style_qualification_for_property = false:suggestion | |
dotnet_style_qualification_for_method = false:suggestion | |
dotnet_style_qualification_for_event = false:suggestion | |
# Prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language_keywords | |
dotnet_style_predefined_type_for_locals_parameters_members = true:warning | |
dotnet_style_predefined_type_for_member_access = true:warning | |
# Modifier preferences | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#normalize_modifiers | |
dotnet_style_require_accessibility_modifiers = always:warning | |
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async | |
dotnet_style_readonly_field = true:warning | |
# Prefer parenthese to clarify binary operators | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#parentheses | |
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning | |
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning | |
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning | |
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion | |
# Expression-level preferences | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level | |
dotnet_style_object_initializer = true:suggestion | |
dotnet_style_collection_initializer = true:suggestion | |
dotnet_style_explicit_tuple_names = true:warning | |
dotnet_style_prefer_inferred_tuple_names = true:suggestion | |
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion | |
dotnet_style_prefer_auto_properties = true:warning | |
dotnet_style_prefer_is_null_check_over_reference_equality_method = false:none | |
dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion | |
dotnet_style_prefer_conditional_expression_over_return = false:suggestion | |
# Null-checking preferences | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking | |
dotnet_style_coalesce_expression = true:suggestion | |
dotnet_style_null_propagation = true:warning | |
# Styles added by Visual Studio 2022 | |
dotnet_style_operator_placement_when_wrapping = beginning_of_line | |
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion | |
dotnet_style_prefer_compound_assignment = true:suggestion | |
dotnet_style_prefer_simplified_interpolation = true:suggestion | |
dotnet_style_namespace_match_folder = true:suggestion | |
# C# Code Style Settings | |
# Implicit and explicit types | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#implicit-and-explicit-types | |
# only use var when it's obvious what the variable type is | |
csharp_style_var_for_built_in_types = false:none | |
csharp_style_var_when_type_is_apparent = false:none | |
csharp_style_var_elsewhere = false:suggestion | |
# Expression-bodied members | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_bodied_members | |
csharp_style_expression_bodied_methods = false:none | |
csharp_style_expression_bodied_constructors = false:none | |
csharp_style_expression_bodied_operators = false:none | |
csharp_style_expression_bodied_properties = when_on_single_line:suggestion | |
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion | |
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion | |
# Pattern matching | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#pattern_matching | |
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion | |
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion | |
# Inlined variable declarations | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#inlined_variable_declarations | |
csharp_style_inlined_variable_declaration = true:suggestion | |
# Expression-level preferences | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level_csharp | |
csharp_prefer_simple_default_expression = true:suggestion | |
csharp_style_deconstructed_variable_declaration = true:suggestion | |
csharp_style_pattern_local_over_anonymous_function = true:warning | |
# "Null" checking preferences | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking_csharp | |
csharp_style_throw_expression = true:warning | |
csharp_style_conditional_delegate_call = true:warning | |
# Code block preferences | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#code_block | |
csharp_prefer_braces = true:warning | |
# Styles added by Visual Studio 2022 | |
csharp_style_namespace_declarations = block_scoped:silent | |
csharp_style_prefer_method_group_conversion = true:silent | |
csharp_style_prefer_top_level_statements = true:silent | |
csharp_style_expression_bodied_lambdas = true:silent | |
csharp_style_expression_bodied_local_functions = false:silent | |
############################# | |
# .NET Formatting Conventions | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions | |
############################# | |
# Organize usings | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#usings | |
dotnet_sort_system_directives_first = true | |
# C# formatting settings | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#c-formatting-settings | |
csharp_new_line_before_open_brace = all | |
csharp_new_line_before_else = true | |
csharp_new_line_before_catch = true | |
csharp_new_line_before_finally = true | |
csharp_new_line_before_members_in_object_initializers = true | |
csharp_new_line_before_members_in_anonymous_types = true | |
csharp_new_line_between_query_expression_clauses = true | |
# Indentation options | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#indent | |
csharp_indent_case_contents = true | |
csharp_indent_switch_labels = true | |
csharp_indent_labels = no_change | |
# Spacing options | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#spacing | |
# require a space between a cast and the value | |
csharp_space_after_cast = true | |
# require a space after a keyword in a control flow statement such as a for loop | |
csharp_space_after_keywords_in_control_flow_statements = true | |
# do not place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list | |
csharp_space_between_method_declaration_parameter_list_parentheses = true | |
# place a space character after the opening parenthesis and before the closing parenthesis of a method call | |
csharp_space_between_method_call_parameter_list_parentheses = true | |
# place a space character between the parentheses of control flow statements and expessions | |
csharp_space_between_parentheses = expressions, control_flow_statements | |
# require a space before the colon for bases or interfaces in a type declaration | |
csharp_space_before_colon_in_inheritance_clause = true | |
# require a space after the colon for bases or interfaces in a type declaration | |
csharp_space_after_colon_in_inheritance_clause = true | |
# insert space before and after a binary operator | |
csharp_space_around_binary_operators = before_and_after | |
# remove space within empty parameter list parentheses for a method declaration | |
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false | |
# remove space between method call name and opening parenthesis | |
csharp_space_between_method_call_name_and_opening_parenthesis = false | |
# remove space within empty argument list parentheses | |
csharp_space_between_method_call_empty_parameter_list_parentheses = false | |
# Wrapping options | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#wrapping | |
csharp_preserve_single_line_statements = false | |
# Controversial - leave code blocks on separate lines | |
csharp_preserve_single_line_blocks = false | |
# More Indentation options (Undocumented) | |
csharp_indent_block_contents = true | |
csharp_indent_braces = false | |
# Spacing Options (Undocumented) | |
csharp_space_after_comma = true | |
csharp_space_after_dot = false | |
csharp_space_after_semicolon_in_for_statement = true | |
csharp_space_around_declaration_statements = do_not_ignore | |
csharp_space_before_comma = false | |
csharp_space_before_dot = false | |
csharp_space_before_semicolon_in_for_statement = false | |
csharp_space_before_open_square_brackets = false | |
csharp_space_between_empty_square_brackets = false | |
csharp_space_between_method_declaration_name_and_open_parenthesis = false | |
csharp_space_between_square_brackets = false | |
# Formatting conventions added by Visual Studio 2022 | |
csharp_using_directive_placement = outside_namespace:silent | |
csharp_prefer_simple_using_statement = true:suggestion | |
######################### | |
# .NET Naming conventions | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions | |
######################### | |
[*.{cs,csx,cake}] | |
# Types | |
dotnet_naming_symbols.non_interface_type_symbol.applicable_kinds = class,struct,enum,delegate | |
dotnet_naming_style.non_interface_type_style.capitalization = pascal_case | |
dotnet_naming_rule.non_interface_types_are_pascal_case.severity = warning | |
dotnet_naming_rule.non_interface_types_are_pascal_case.symbols = non_interface_type_symbol | |
dotnet_naming_rule.non_interface_types_are_pascal_case.style = non_interface_type_style | |
# Interface | |
dotnet_naming_symbols.interface_type_symbol.applicable_kinds = interface | |
dotnet_naming_style.interface_type_style.capitalization = pascal_case | |
dotnet_naming_style.interface_type_style.required_prefix = I | |
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = warning | |
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_type_symbol | |
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = interface_type_style | |
# Methods, properties and events | |
dotnet_naming_symbols.member_symbol.applicable_kinds = method,property,event | |
dotnet_naming_style.member_style.capitalization = pascal_case | |
dotnet_naming_rule.members_are_pascal_case.severity = warning | |
dotnet_naming_rule.members_are_pascal_case.symbols = member_symbol | |
dotnet_naming_rule.members_are_pascal_case.style = member_style | |
# Parameters | |
dotnet_naming_symbols.parameter_symbol.applicable_kinds = parameter | |
dotnet_naming_style.parameter_style.capitalization = camel_case | |
dotnet_naming_rule.parameters_are_camel_case.severity = warning | |
dotnet_naming_rule.parameters_are_camel_case.symbols = parameter_symbol | |
dotnet_naming_rule.parameters_are_camel_case.style = parameter_style | |
# Fields (not private) | |
dotnet_naming_symbols.non_private_field_symbol.applicable_kinds = field | |
dotnet_naming_symbols.non_private_field_symbol.applicable_accessibilities = public,internal,friend,protected,protected_internal,protected_friend | |
dotnet_naming_style.non_private_field_style.capitalization = pascal_case | |
dotnet_naming_rule.non_private_fields_are_pascal_case.severity = error | |
dotnet_naming_rule.non_private_fields_are_pascal_case.symbols = non_private_field_symbol | |
dotnet_naming_rule.non_private_fields_are_pascal_case.style = non_private_field_style | |
# Instance fields (private) | |
dotnet_naming_symbols.private_field_symbol.applicable_kinds = field | |
dotnet_naming_symbols.private_field_symbol.applicable_accessibilities = private | |
dotnet_naming_style.private_field_style.capitalization = camel_case | |
dotnet_naming_style.private_field_style.required_prefix = _ | |
dotnet_naming_rule.private_fields_are_camel_case.severity = warning | |
dotnet_naming_rule.private_fields_are_camel_case.symbols = private_field_symbol | |
dotnet_naming_rule.private_fields_are_camel_case.style = private_field_style | |
# Constant fields (not private) (private) | |
dotnet_naming_symbols.constant_fields.applicable_kinds = field | |
dotnet_naming_symbols.constant_fields.required_modifiers = const | |
dotnet_naming_rule.constant_fields_must_be_pascal_case.severity = warning | |
dotnet_naming_rule.constant_fields_must_be_pascal_case.symbols = constant_fields | |
dotnet_naming_rule.constant_fields_must_be_pascal_case.style = pascal_case | |
# Static readonly fields (not private) (private) | |
dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field | |
dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly | |
dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = warning | |
dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields | |
dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case | |
#################################################################### | |
### Resharper Options => Code Editing => C# => Formatting Style | |
### | |
### https://www.jetbrains.com/help/resharper/EditorConfig_Index.html | |
#################################################################### | |
#### Tab, Indents, Alignment Options (ReSharper) | |
# General | |
[*.{cs,csx,cake}] | |
resharper_csharp_continuous_indent_multiplier = 1 | |
# Nested Statements | |
resharper_csharp_indent_nested_usings_stmt = true | |
resharper_csharp_indent_nested_fixed_stmt = true | |
resharper_csharp_indent_nested_lock_stmt = true | |
resharper_csharp_indent_nested_for_stmt = true | |
resharper_csharp_indent_nested_foreach_stmt = true | |
resharper_csharp_indent_nested_while_stmt = true | |
# Parenthesis | |
resharper_csharp_use_continuous_indent_inside_parens = true | |
resharper_csharp_indent_method_decl_pars = inside | |
resharper_csharp_indent_invocation_pars = inside | |
resharper_csharp_indent_statement_pars = inside | |
resharper_csharp_indent_typeparam_angles = inside | |
resharper_csharp_indent_typearg_angles = inside | |
resharper_csharp_indent_pars = inside | |
# Preprocessor Directives | |
resharper_csharp_indent_preprocessor_if = no_indent | |
resharper_csharp_indent_preprocessor_region = usual_indent | |
resharper_csharp_indent_preprocessor_other = no_indent | |
# Other Indents | |
resharper_csharp_indent_type_constraints = true | |
resharper_csharp_stick_comment = false | |
# Align Multiline Constructs | |
resharper_csharp_align_multiline_parameter = true | |
resharper_csharp_align_multiline_extends_list = false | |
resharper_csharp_align_linq_query = true | |
resharper_csharp_align_multiline_binary_expressions_chain = true | |
resharper_csharp_outdent_binary_ops = false | |
resharper_csharp_align_multiline_calls_chain = true | |
resharper_csharp_outdent_dots = false | |
resharper_csharp_align_multiline_array_and_object_initializer = false | |
resharper_csharp_indent_anonymous_method_block = true | |
resharper_csharp_align_first_arg_by_paren = true | |
resharper_csharp_align_multiline_argument = true | |
resharper_csharp_align_tuple_components = false | |
resharper_csharp_align_multiline_expression = false | |
resharper_csharp_align_multiline_for_stmt = true | |
resharper_csharp_align_multiple_declaration = true | |
resharper_csharp_align_multline_type_parameter_list = false | |
resharper_csharp_align_multline_type_parameter_constrains = true | |
resharper_csharp_outdent_commas = false | |
# Align Similar Code in Columns | |
resharper_csharp_int_align_fields = false | |
resharper_csharp_int_align_properties = false | |
resharper_csharp_int_align = false | |
resharper_csharp_int_align_methods = false | |
resharper_csharp_int_align_parameters = false | |
resharper_csharp_int_align_variables = false | |
resharper_csharp_int_align_assignments = false | |
resharper_csharp_int_align_nested_ternary = false | |
resharper_csharp_int_align_invocations = false | |
resharper_csharp_int_align_binary_expressions = false | |
resharper_csharp_int_align_comments = false | |
resharper_csharp_int_align_switch_sections = false | |
### Braces Layout Options (ReSharper) | |
resharper_csharp_brace_style = next_line | |
resharper_csharp_indent_inside_namespace = true | |
resharper_csharp_type_declaration_braces = next_line | |
resharper_csharp_invocable_declaration_braces = next_line | |
resharper_csharp_anonymous_method_declaration_braces = next_line | |
resharper_csharp_accessor_owner_declaration_braces = next_line | |
resharper_csharp_accessor_declaration_braces = next_line | |
resharper_csharp_case_block_braces = next_line | |
resharper_csharp_initializer_braces = next_line | |
resharper_csharp_use_continuous_indent_inside_initializer_braces = true | |
resharper_csharp_other_braces = next_line | |
resharper_csharp_allow_comment_after_lbrace = false | |
resharper_csharp_empty_block_style = together_same_line | |
### Blank Lines Options (ReSharper) | |
# General | |
resharper_csharp_blank_lines_around_region = 1 | |
resharper_csharp_blank_lines_inside_region = 1 | |
resharper_csharp_blank_lines_before_single_line_comment = 0 | |
# Blank Lines in Declarations | |
resharper_csharp_keep_blank_lines_in_declarations = 2 | |
resharper_csharp_remove_blank_lines_near_braces_in_declarations = true | |
resharper_csharp_blank_lines_after_start_comment = 1 | |
resharper_csharp_blank_lines_between_using_groups = 0 | |
resharper_csharp_blank_lines_after_using_list = 1 | |
resharper_csharp_blank_lines_around_namespace = 1 | |
resharper_csharp_blank_lines_inside_namespace = 0 | |
resharper_csharp_blank_lines_around_type = 1 | |
resharper_csharp_blank_lines_inside_type = 0 | |
resharper_csharp_blank_lines_around_field = 1 | |
resharper_csharp_blank_lines_around_single_line_field = 0 | |
resharper_csharp_blank_lines_around_property = 1 | |
resharper_csharp_blank_lines_around_single_line_property = 0 | |
resharper_csharp_blank_lines_around_auto_property = 1 | |
resharper_csharp_blank_lines_around_single_line_auto_property = 0 | |
resharper_csharp_blank_lines_around_invocable = 1 | |
resharper_csharp_blank_lines_around_single_line_invocable = 0 | |
# Blank Lines in Code | |
resharper_csharp_keep_blank_lines_in_code = 1 | |
resharper_csharp_remove_blank_lines_near_braces_in_code = true | |
resharper_csharp_blank_lines_around_local_method = 1 | |
resharper_csharp_blank_lines_around_single_line_local_method = 0 | |
resharper_csharp_blank_lines_before_control_transfer_statements = 0 | |
resharper_csharp_blank_lines_after_control_transfer_statements = 0 | |
resharper_csharp_blank_lines_before_block_statements = 0 | |
resharper_csharp_blank_lines_after_block_statements = 1 | |
resharper_csharp_blank_lines_before_multiline_statements = 0 | |
resharper_csharp_blank_lines_after_multiline_statements = 0 | |
### Line Breaks and Wrapping (ReSharper) | |
# General | |
resharper_csharp_keep_user_linebreaks = true | |
resharper_csharp_wrap_before_comma = false | |
resharper_csharp_special_else_if_treatment = true | |
# Arrangement of Attributes | |
resharper_csharp_max_attribute_length_for_same_line = 38 | |
resharper_csharp_keep_existing_attribute_arrangement = false | |
resharper_csharp_place_attribute_on_same_line = never | |
resharper_csharp_place_type_attribute_on_same_line = never | |
resharper_csharp_place_method_attribute_on_same_line = never | |
resharper_csharp_place_accessorholder_attribute_on_same_line = never | |
resharper_csharp_place_accessor_attribute_on_same_line = never | |
resharper_csharp_place_field_attribute_on_same_line = never | |
# Arrangement of Method Signatures | |
resharper_csharp_wrap_parameters_style = wrap_if_long | |
resharper_csharp_keep_existing_declaration_parens_arrangement = true | |
resharper_csharp_wrap_before_declaration_lpar = false | |
resharper_csharp_wrap_after_declaration_lpar = false | |
resharper_csharp_wrap_before_declaration_rpar = false | |
resharper_csharp_place_constructor_initializer_on_same_line = false | |
# Arrangement of Expression Bodied Members | |
resharper_csharp_keep_existing_expr_member_arrangement = true | |
resharper_csharp_place_expr_method_on_single_line = if_owner_is_single_line | |
resharper_csharp_place_expr_property_on_single_line = if_owner_is_single_line | |
resharper_csharp_place_expr_accessor_on_single_line = if_owner_is_single_line | |
resharper_csharp_wrap_before_arrow_with_expressions = false | |
# Arrangement of Type Parameters, Constraints and Base Types | |
resharper_csharp_place_type_constraints_on_same_line = true | |
resharper_csharp_wrap_before_first_type_parameter_constraint = false | |
resharper_csharp_wrap_multiple_type_parameter_constraints_style = chop_if_long | |
resharper_csharp_wrap_before_type_parameter_langle = false | |
resharper_csharp_wrap_before_extends_colon = false | |
resharper_csharp_wrap_extends_list_style = wrap_if_long | |
# Arrangement of Declaration Blocks | |
resharper_csharp_keep_existing_declaration_block_arrangement = false | |
resharper_csharp_place_abstract_accessorholder_on_single_line = false | |
resharper_csharp_place_simple_blocks_on_single_line = false | |
resharper_csharp_place_simple_declaration_blocks_on_single_line = false | |
resharper_csharp_place_simple_accessorholder_on_single_line = false | |
resharper_csharp_place_accessor_with_attrs_holder_on_single_line = false | |
resharper_csharp_place_simple_accessor_on_single_line = false | |
resharper_csharp_place_simple_method_on_single_line = false | |
# Arrangement of Enumerations | |
resharper_csharp_keep_existing_enum_arrangement = false | |
resharper_csharp_max_enum_members_on_line = 1 | |
resharper_csharp_place_simple_enum_on_single_line = false | |
resharper_csharp_wrap_enum_declaration = chop_always | |
# Arrangement of Statements | |
resharper_csharp_new_line_before_while = true | |
resharper_csharp_wrap_for_stmt_header_style = chop_if_long | |
resharper_csharp_wrap_multiple_declaration_style = wrap_if_long | |
# Arrangement of Embedded Statements | |
resharper_csharp_keep_existing_embedded_arrangement = true | |
resharper_csharp_place_simple_embedded_statement_on_same_line = if_owner_is_single_line | |
resharper_csharp_place_simple_case_statement_on_same_line = never | |
# Arrangement of Embedded Blocks | |
resharper_csharp_keep_existing_embedded_block_arrangement = false | |
resharper_csharp_place_simple_embedded_block_on_same_line = false | |
resharper_csharp_place_simple_anonymousmethod_on_single_line = false | |
# Arrangement of Initializers | |
resharper_csharp_keep_existing_initializer_arrangement = false | |
resharper_csharp_place_simple_initializer_on_single_line = false | |
resharper_csharp_max_initializer_elements_on_line = 1 | |
resharper_csharp_wrap_object_and_collection_initializer_style = chop_always | |
resharper_csharp_wrap_array_initializer_style = wrap_if_long | |
# Arrangement of Invocations | |
resharper_csharp_wrap_arguments_style = wrap_if_long | |
resharper_csharp_keep_existing_invocation_parens_arrangement = true | |
resharper_csharp_wrap_before_invocation_lpar = false | |
resharper_csharp_wrap_after_invocation_lpar = false | |
resharper_csharp_wrap_before_invocation_rpar = false | |
# Arrangement of Member Access Expressions | |
resharper_csharp_wrap_after_dot_in_method_calls = false | |
resharper_csharp_wrap_chained_method_calls = wrap_if_long | |
# Arrangement of Binary Expressions | |
resharper_csharp_wrap_before_binary_opsign = false | |
resharper_csharp_wrap_chained_binary_expressions = wrap_if_long | |
resharper_csharp_force_chop_compound_if_expression = false | |
resharper_csharp_force_chop_compound_while_expression = false | |
resharper_csharp_force_chop_compound_do_expression = false | |
# Arrangement of Ternaly Expressions | |
resharper_csharp_wrap_before_ternary_opsigns = false | |
resharper_csharp_wrap_ternary_expr_style = wrap_if_long | |
resharper_csharp_nested_ternary_style = autodetect | |
# Arrangement of LINQ Expressions | |
resharper_csharp_wrap_linq_expressions = chop_always | |
resharper_csharp_wrap_before_linq_expression = false | |
resharper_csharp_place_linq_into_on_new_line = true | |
# Arrangement of interpolated strings | |
resharper_csharp_wrap_verbatim_interpolated_strings = no_wrap | |
### Spaces Options (ReSharper) | |
# Preserve Existing Formatting | |
resharper_csharp_extra_spaces = remove_all | |
# Before Parentheses in Statements | |
resharper_csharp_space_before_if_parentheses = true | |
resharper_csharp_space_before_while_parentheses = true | |
resharper_csharp_space_before_catch_parentheses = true | |
resharper_csharp_space_before_switch_parentheses = true | |
resharper_csharp_space_before_for_parentheses = true | |
resharper_csharp_space_before_foreach_parentheses = true | |
resharper_csharp_space_before_using_parentheses = true | |
resharper_csharp_space_before_lock_parentheses = true | |
resharper_csharp_space_before_fixed_parentheses = true | |
# Before Other Parentheses | |
resharper_csharp_space_before_method_call_parentheses = false | |
resharper_csharp_space_before_empty_method_call_parentheses = false | |
resharper_csharp_space_before_method_parentheses = false | |
resharper_csharp_space_before_empty_method_parentheses = false | |
resharper_csharp_space_before_typeof_parentheses = false | |
resharper_csharp_space_before_default_parentheses = false | |
resharper_csharp_space_before_checked_parentheses = false | |
resharper_csharp_space_before_sizeof_parentheses = false | |
resharper_csharp_space_before_nameof_parentheses = false | |
resharper_csharp_space_between_keyword_and_expression = true | |
resharper_csharp_space_between_keyword_and_type = true | |
# Within Parentheses in Statements | |
resharper_csharp_space_within_if_parentheses = true | |
resharper_csharp_space_between_parentheses_of_control_flow_statements = true | |
resharper_csharp_space_within_catch_parentheses = true | |
resharper_csharp_space_within_switch_parentheses = true | |
resharper_csharp_space_within_for_parentheses = true | |
resharper_csharp_space_within_foreach_parentheses = true | |
resharper_csharp_space_within_using_parentheses = true | |
resharper_csharp_space_within_lock_parentheses = true | |
resharper_csharp_space_within_fixed_parentheses = true | |
# Within Other Parentheses | |
resharper_csharp_space_within_parentheses = true | |
resharper_csharp_space_between_typecast_parentheses = false | |
resharper_csharp_space_within_typeof_parentheses = true | |
resharper_csharp_space_within_default_parentheses = true | |
resharper_csharp_space_within_checked_parentheses = true | |
resharper_csharp_space_within_sizeof_parentheses = true | |
resharper_csharp_space_within_nameof_parentheses = true | |
# Around array Brackets | |
resharper_csharp_space_before_array_access_brackets = false | |
resharper_csharp_space_before_array_rank_brackets = false | |
resharper_csharp_space_within_array_access_brackets = false | |
resharper_csharp_space_within_array_rank_brackets = false | |
resharper_csharp_space_within_array_rank_empty_brackets = false | |
# Around Angle Brackets | |
resharper_csharp_space_before_type_parameter_angle = false | |
resharper_csharp_space_before_type_argument_angle = false | |
resharper_csharp_space_within_type_parameter_angles = false | |
resharper_csharp_space_within_type_argument_angles = false | |
# Around Braces | |
resharper_csharp_space_before_singleline_accessorholder = true | |
resharper_csharp_space_in_singleline_accessorholder = true | |
resharper_csharp_space_between_accessors_in_singleline_property = true | |
resharper_csharp_space_within_empty_braces = true | |
resharper_csharp_space_in_singleline_method = true | |
resharper_csharp_space_in_singleline_anonymous_method = true | |
resharper_csharp_space_within_single_line_array_initializer_braces = true | |
# Around Binary Operators | |
resharper_csharp_space_around_assignment_op = true | |
resharper_csharp_space_around_logical_op = true | |
resharper_csharp_space_around_equality_op = true | |
resharper_csharp_space_around_relational_op = true | |
resharper_csharp_space_around_bitwise_op = true | |
resharper_csharp_space_around_additive_op = true | |
resharper_csharp_space_around_multiplicative_op = true | |
resharper_csharp_space_around_shift_op = true | |
resharper_csharp_space_around_nullcoalescing_op = true | |
resharper_csharp_space_around_arrow_op = true | |
# After Unary Operators | |
resharper_csharp_space_after_logical_not_op = false | |
resharper_csharp_space_after_unary_minus_op = false | |
resharper_csharp_space_after_unary_plus_op = false | |
resharper_csharp_space_after_ampersand_op = false | |
resharper_csharp_space_after_asterik_op = false | |
resharper_csharp_space_near_postfix_and_prefix_op = false | |
# In Ternary Operator | |
resharper_csharp_space_before_ternary_quest = true | |
resharper_csharp_space_around_ternary_operator = true | |
resharper_csharp_space_after_ternary_quest = true | |
resharper_csharp_space_before_ternary_colon = true | |
# Around Comma and Semicolon | |
resharper_csharp_space_before_semicolon = false | |
# Around Colon | |
resharper_csharp_space_before_type_parameter_constraint_colon = true | |
resharper_csharp_space_after_type_parameter_constraint_colon = true | |
resharper_csharp_space_before_colon_in_case = false | |
resharper_csharp_space_after_colon_in_case = true | |
resharper_csharp_space_before_attribute_colon = false | |
resharper_csharp_space_after_attribute_colon = true | |
# Attributes | |
resharper_csharp_space_between_attribute_sections = true | |
resharper_csharp_space_within_attribute_brackets = false | |
resharper_csharp_space_after_attributes = true | |
# Other | |
resharper_csharp_space_around_dot = false | |
resharper_csharp_space_around_lambda_arrow = true | |
resharper_csharp_space_before_pointer_asterik_declaration = false | |
resharper_csharp_space_before_nullable_mark = false | |
resharper_csharp_space_around_alias_eq = true | |
resharper_csharp_space_before_trailing_comment = true | |
resharper_csharp_space_after_operator_keyword = true | |
################################################################ | |
### Resharper Options => Code Editing => C# => Code Style | |
################################################################ | |
### C# CodeStyle Options (ReSharper) | |
# var Usage in Declarations | |
resharper_csharp_for_built_in_types = use_explicit_type:none | |
resharper_csharp_for_simple_types = use_var_when_evident:none | |
resharper_csharp_for_other_types = use_var_when_evident:suggestion | |
resharper_csharp_prefer_separate_deconstructed_variables_declaration = false | |
resharper_csharp_prefer_explicit_discard_declaration = false | |
# Instance Members Qualification | |
resharper_csharp_instance_members_qualify_members = none:suggestion | |
resharper_csharp_instance_members_qualify_declared_in = this_class, base_class | |
# Static Members Qualification | |
resharper_csharp_static_members_qualify_with = declared_type | |
resharper_csharp_static_members_qualify_members = none | |
# Built-in Type Naming | |
resharper_csharp_builtin_type_reference_style = use_keyword:warning | |
resharper_csharp_builtin_type_reference_for_member_access_style = use_keyword:warning | |
# Reference Qualification | |
resharper_csharp_prefer_qualified_reference = false | |
resharper_csharp_add_imports_to_deepest_scope = false | |
resharper_csharp_qualified_using_at_nested_scope = false | |
resharper_csharp_allow_alias = true | |
resharper_csharp_can_use_global_alias = true | |
# Modifiers | |
resharper_csharp_default_private_modifier = explicit:warning | |
resharper_csharp_default_internal_modifier = explicit:suggestion | |
resharper_csharp_modifiers_order = public private protected internal static extern new virtual abstract sealed override readonly unsafe volatile async :suggestion | |
# Arguments | |
resharper_csharp_arguments_skip_single = false | |
resharper_csharp_arguments_literal = positional | |
resharper_csharp_arguments_string_literal = positional | |
resharper_csharp_arguments_named = positional | |
resharper_csharp_arguments_anonymous_function = positional | |
resharper_csharp_arguments_other = positional | |
# Parentheses () | |
resharper_csharp_parentheses_redundancy_style = remove_if_not_clarifies_precedence | |
resharper_csharp_parentheses_non_obvious_operations = shift,bitwise | |
# Braces {} | |
resharper_csharp_braces_for_ifelse = required:warning | |
resharper_csharp_braces_for_for = required:warning | |
resharper_csharp_braces_for_foreach = required:warning | |
resharper_csharp_braces_for_while = required:warning | |
resharper_csharp_braces_for_dowhile = required:warning | |
resharper_csharp_braces_for_using = required:warning | |
resharper_csharp_braces_for_lock = required:warning | |
resharper_csharp_braces_for_fixed = required:warning | |
resharper_csharp_braces_redundant = true:warning | |
# Code Body | |
resharper_csharp_method_or_operator_body = block_body:none | |
resharper_csharp_local_function_body = block_body | |
resharper_csharp_constructor_or_destructor_body = block_body:none | |
resharper_csharp_accessor_owner_body = expression_body:suggestion | |
resharper_csharp_use_heuristics_for_body_style = true | |
# Attributes | |
resharper_csharp_force_attribute_style = separate | |
resharper_arrange_attributes_highlighting = hint | |
################################################################ | |
### Static Analysis Overrides | |
################################################################ | |
# Remove underscores from member names | |
# Ignore because our test pattern is [UnitOfWork_StateUnderTest_ExpectedBehavior] | |
dotnet_diagnostic.CA1707.severity = none |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you sure that rules for const and static readonly fields are working correctly? To me it suggest to change name to _camelCase instead PascalCase.