root = true [*] charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = space indent_size = 4 [*.{json,yml,yaml,nix,csproj,props,targets,slnx,xml}] indent_size = 2 [*.md] trim_trailing_whitespace = false [*.cs] # Namespaces and usings csharp_style_namespace_declarations = file_scoped:warning csharp_using_directive_placement = outside_namespace:warning dotnet_sort_system_directives_first = true # Language preferences dotnet_style_qualification_for_field = false:warning dotnet_style_qualification_for_property = false:warning dotnet_style_qualification_for_method = false:warning dotnet_style_predefined_type_for_locals_parameters_members = true:warning csharp_style_var_for_built_in_types = false:suggestion csharp_style_var_when_type_is_apparent = true:suggestion csharp_style_var_elsewhere = false:suggestion csharp_prefer_braces = true:warning csharp_style_expression_bodied_methods = when_on_single_line:suggestion csharp_style_prefer_primary_constructors = true:suggestion dotnet_style_readonly_field = true:warning # Formatting 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 # Naming: interfaces start with I, private fields start with _ dotnet_naming_rule.interfaces_begin_with_i.symbols = interfaces dotnet_naming_rule.interfaces_begin_with_i.style = begins_with_i dotnet_naming_rule.interfaces_begin_with_i.severity = warning dotnet_naming_symbols.interfaces.applicable_kinds = interface dotnet_naming_style.begins_with_i.required_prefix = I dotnet_naming_style.begins_with_i.capitalization = pascal_case dotnet_naming_rule.private_fields_underscore.symbols = private_fields dotnet_naming_rule.private_fields_underscore.style = underscore_camel dotnet_naming_rule.private_fields_underscore.severity = warning dotnet_naming_symbols.private_fields.applicable_kinds = field dotnet_naming_symbols.private_fields.applicable_accessibilities = private dotnet_naming_style.underscore_camel.required_prefix = _ dotnet_naming_style.underscore_camel.capitalization = camel_case # Tests: allow underscores in method names (Method_Scenario_Expected) [tests/**/*.cs] dotnet_diagnostic.CA1707.severity = none