Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / paths-filter (push) Waiting to run
dotnet-build-and-test / dotnet-build-and-test (Debug, windows-latest, net9.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test (Release, integration, true, ubuntu-latest, net10.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test (Release, integration, true, windows-latest, net472) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test (Release, ubuntu-latest, net8.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test-check (push) Blocked by required conditions
449 lines
26 KiB
INI
449 lines
26 KiB
INI
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
|
|
###############################
|
|
# Core EditorConfig Options #
|
|
###############################
|
|
root = true
|
|
# All files
|
|
[*]
|
|
indent_style = space
|
|
end_of_line = lf
|
|
|
|
# XML project files
|
|
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
|
|
indent_size = 2
|
|
|
|
# XML config files
|
|
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
|
|
indent_size = 2
|
|
|
|
# YAML config files
|
|
[*.{yml,yaml}]
|
|
tab_width = 2
|
|
indent_size = 2
|
|
insert_final_newline = true
|
|
trim_trailing_whitespace = true
|
|
|
|
# JSON config files
|
|
[*.json]
|
|
tab_width = 2
|
|
indent_size = 2
|
|
insert_final_newline = false
|
|
trim_trailing_whitespace = true
|
|
|
|
# Typescript files
|
|
[*.{ts,tsx}]
|
|
insert_final_newline = true
|
|
trim_trailing_whitespace = true
|
|
tab_width = 4
|
|
indent_size = 4
|
|
file_header_template = Copyright (c) Microsoft. All rights reserved.
|
|
|
|
# Stylesheet files
|
|
[*.{css,scss,sass,less}]
|
|
insert_final_newline = true
|
|
trim_trailing_whitespace = true
|
|
tab_width = 4
|
|
indent_size = 4
|
|
|
|
# Code files
|
|
[*.{cs,csx,vb,vbx}]
|
|
tab_width = 4
|
|
indent_size = 4
|
|
insert_final_newline = true
|
|
trim_trailing_whitespace = true
|
|
charset = utf-8-bom
|
|
file_header_template = Copyright (c) Microsoft. All rights reserved.
|
|
|
|
###############################
|
|
# .NET Coding Conventions #
|
|
###############################
|
|
[*.{cs,vb}]
|
|
# Organize usings
|
|
dotnet_sort_system_directives_first = true
|
|
# this. preferences
|
|
dotnet_style_qualification_for_field = true:error
|
|
dotnet_style_qualification_for_property = true:error
|
|
dotnet_style_qualification_for_method = true:error
|
|
dotnet_style_qualification_for_event = true:error
|
|
# Language keywords vs BCL types preferences
|
|
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
|
dotnet_style_predefined_type_for_member_access = true:suggestion
|
|
# Parentheses preferences
|
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
|
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
|
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
|
# Modifier preferences
|
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
|
|
dotnet_style_readonly_field = true:warning
|
|
# Expression-level preferences
|
|
dotnet_style_object_initializer = true:suggestion
|
|
dotnet_style_collection_initializer = true:suggestion
|
|
dotnet_style_explicit_tuple_names = true:suggestion
|
|
dotnet_style_null_propagation = true:suggestion
|
|
dotnet_style_coalesce_expression = true:suggestion
|
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
|
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:silent
|
|
dotnet_style_prefer_auto_properties = true:suggestion
|
|
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
|
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
|
dotnet_style_prefer_simplified_interpolation = true:suggestion
|
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
|
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
|
|
dotnet_style_prefer_compound_assignment = true:suggestion
|
|
# Code quality rules
|
|
dotnet_code_quality_unused_parameters = all:suggestion
|
|
|
|
[*.cs]
|
|
# Note: these settings cause "dotnet format" to fix the code. You should review each change if you uses "dotnet format".
|
|
dotnet_diagnostic.RCS1036.severity = warning # Remove unnecessary blank line.
|
|
dotnet_diagnostic.RCS1037.severity = warning # Remove trailing white-space.
|
|
dotnet_diagnostic.RCS1097.severity = warning # Remove redundant 'ToString' call.
|
|
dotnet_diagnostic.RCS1138.severity = warning # Add summary to documentation comment.
|
|
dotnet_diagnostic.RCS1139.severity = warning # Add summary element to documentation comment.
|
|
dotnet_diagnostic.RCS1168.severity = warning # Parameter name 'foo' differs from base name 'bar'.
|
|
dotnet_diagnostic.RCS1175.severity = warning # Unused 'this' parameter 'operation'.
|
|
dotnet_diagnostic.RCS1192.severity = warning # Unnecessary usage of verbatim string literal.
|
|
dotnet_diagnostic.RCS1194.severity = warning # Implement exception constructors.
|
|
dotnet_diagnostic.RCS1211.severity = warning # Remove unnecessary else clause.
|
|
dotnet_diagnostic.RCS1214.severity = warning # Unnecessary interpolated string.
|
|
dotnet_diagnostic.RCS1225.severity = warning # Make class sealed.
|
|
dotnet_diagnostic.RCS1232.severity = warning # Order elements in documentation comment.
|
|
|
|
# Commented out because `dotnet format` change can be disruptive.
|
|
# dotnet_diagnostic.RCS1085.severity = warning # Use auto-implemented property.
|
|
|
|
# Commented out because `dotnet format` removes the xmldoc element, while we should add the missing documentation instead.
|
|
# dotnet_diagnostic.RCS1228.severity = warning # Unused element in documentation comment.
|
|
|
|
# Diagnostics elevated as warnings
|
|
dotnet_diagnostic.CA1000.severity = warning # Do not declare static members on generic types
|
|
dotnet_diagnostic.CA1050.severity = warning # Declare types in namespaces
|
|
dotnet_diagnostic.CA1063.severity = warning # Implement IDisposable correctly
|
|
dotnet_diagnostic.CA1064.severity = warning # Exceptions should be public
|
|
dotnet_diagnostic.CA1416.severity = warning # Validate platform compatibility
|
|
dotnet_diagnostic.CA1508.severity = warning # Avoid dead conditional code
|
|
dotnet_diagnostic.CA1805.severity = warning # Member is explicitly initialized to its default value
|
|
dotnet_diagnostic.CA1822.severity = suggestion # Member does not access instance data and can be marked as static
|
|
dotnet_diagnostic.CA1852.severity = warning # Sealed classes
|
|
dotnet_diagnostic.CA1859.severity = warning # Use concrete types when possible for improved performance
|
|
dotnet_diagnostic.CA1860.severity = warning # Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
|
dotnet_diagnostic.CA2007.severity = warning # Do not directly await a Task
|
|
dotnet_diagnostic.CA2201.severity = warning # Exception type System.Exception is not sufficiently specific
|
|
|
|
dotnet_diagnostic.IDE0001.severity = warning # Simplify name
|
|
dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary using directives
|
|
dotnet_diagnostic.IDE0009.severity = warning # Add this or Me qualification
|
|
dotnet_diagnostic.IDE0011.severity = warning # Add braces
|
|
dotnet_diagnostic.IDE0018.severity = warning # Inline variable declaration
|
|
dotnet_diagnostic.IDE0032.severity = warning # Use auto-implemented property
|
|
dotnet_diagnostic.IDE0034.severity = warning # Simplify 'default' expression
|
|
dotnet_diagnostic.IDE0035.severity = warning # Remove unreachable code
|
|
dotnet_diagnostic.IDE0040.severity = warning # Add accessibility modifiers
|
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references
|
|
dotnet_diagnostic.IDE0050.severity = warning # Convert anonymous type to tuple
|
|
dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member
|
|
dotnet_diagnostic.IDE0055.severity = warning # Formatting rule
|
|
dotnet_diagnostic.IDE0060.severity = warning # Remove unused parameter
|
|
dotnet_diagnostic.IDE0070.severity = warning # Use 'System.HashCode.Combine'
|
|
dotnet_diagnostic.IDE0071.severity = warning # Simplify interpolation
|
|
dotnet_diagnostic.IDE0073.severity = warning # Require file header
|
|
dotnet_diagnostic.IDE0082.severity = warning # Convert typeof to nameof
|
|
dotnet_diagnostic.IDE0090.severity = warning # Simplify new expression
|
|
dotnet_diagnostic.IDE0161.severity = warning # Use file-scoped namespace
|
|
dotnet_diagnostic.IDE0280.severity = warning # Use nameof
|
|
|
|
dotnet_diagnostic.VSTHRD111.severity = warning # Use .ConfigureAwait(bool)
|
|
dotnet_diagnostic.VSTHRD200.severity = warning # Use Async suffix for async methods
|
|
|
|
dotnet_diagnostic.RCS1021.severity = warning # Use expression-bodied lambda.
|
|
dotnet_diagnostic.RCS1061.severity = warning # Merge 'if' with nested 'if'.
|
|
dotnet_diagnostic.RCS1069.severity = warning # Remove unnecessary case label.
|
|
dotnet_diagnostic.RCS1077.severity = warning # Optimize LINQ method call.
|
|
dotnet_diagnostic.RCS1118.severity = warning # Mark local variable as const.
|
|
dotnet_diagnostic.RCS1124.severity = warning # Inline local variable.
|
|
dotnet_diagnostic.RCS1129.severity = warning # Remove redundant field initialization.
|
|
dotnet_diagnostic.RCS1146.severity = warning # Use conditional access.
|
|
dotnet_diagnostic.RCS1170.severity = warning # Use read-only auto-implemented property.
|
|
dotnet_diagnostic.RCS1173.severity = warning # Use coalesce expression instead of 'if'.
|
|
dotnet_diagnostic.RCS1186.severity = warning # Use Regex instance instead of static method.
|
|
dotnet_diagnostic.RCS1188.severity = warning # Remove redundant auto-property initialization.
|
|
dotnet_diagnostic.RCS1197.severity = suggestion # Optimize StringBuilder.AppendLine call.
|
|
dotnet_diagnostic.RCS1201.severity = suggestion # Use method chaining.
|
|
|
|
dotnet_diagnostic.IDE0001.severity = warning # Simplify name
|
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify member access
|
|
dotnet_diagnostic.IDE0004.severity = warning # Remove unnecessary cast
|
|
dotnet_diagnostic.IDE0032.severity = warning # Use auto property
|
|
dotnet_diagnostic.IDE0035.severity = warning # Remove unreachable code
|
|
dotnet_diagnostic.IDE0047.severity = warning # Parentheses can be removed
|
|
dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member
|
|
dotnet_diagnostic.IDE0052.severity = warning # Remove unread private member
|
|
dotnet_diagnostic.IDE0059.severity = warning # Unnecessary assignment of a value
|
|
dotnet_diagnostic.IDE0110.severity = warning # Remove unnecessary discards
|
|
dotnet_diagnostic.IDE1006.severity = warning # Naming rule violations
|
|
|
|
# Suppressed diagnostics
|
|
dotnet_diagnostic.CA1002.severity = none # Change 'List<string>' in '...' to use 'Collection<T>' ...
|
|
dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types
|
|
dotnet_diagnostic.CA1032.severity = none # We're using RCS1194 which seems to cover more ctors
|
|
dotnet_diagnostic.CA1034.severity = none # Do not nest type. Alternatively, change its accessibility so that it is not externally visible
|
|
dotnet_diagnostic.CA1054.severity = none # Uri parameters should not be strings
|
|
dotnet_diagnostic.CA1062.severity = none # Disable null check, C# already does it for us
|
|
dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters
|
|
dotnet_diagnostic.CA1305.severity = none # Operation could vary based on current user's locale settings
|
|
dotnet_diagnostic.CA1307.severity = none # Operation has an overload that takes a StringComparison
|
|
dotnet_diagnostic.CA1508.severity = none # Avoid dead conditional code. Too many false positives.
|
|
dotnet_diagnostic.CA1510.severity = none # ArgumentNullException.Throw
|
|
dotnet_diagnostic.CA1512.severity = none # ArgumentOutOfRangeException.Throw
|
|
dotnet_diagnostic.CA1515.severity = none # Making public types from exes internal
|
|
dotnet_diagnostic.CA1707.severity = none # Identifiers should not contain underscores
|
|
dotnet_diagnostic.CA1846.severity = none # Prefer 'AsSpan' over 'Substring'
|
|
dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates
|
|
dotnet_diagnostic.CA1849.severity = none # Use async equivalent; analyzer is currently noisy
|
|
dotnet_diagnostic.CA1865.severity = none # StartsWith(char)
|
|
dotnet_diagnostic.CA1867.severity = none # EndsWith(char)
|
|
dotnet_diagnostic.CS1998.severity = none # async method lacks 'await' operators and will run synchronously
|
|
dotnet_diagnostic.CA2000.severity = none # Call System.IDisposable.Dispose on object before all references to it are out of scope
|
|
dotnet_diagnostic.CA2225.severity = none # Operator overloads have named alternates
|
|
dotnet_diagnostic.CA2227.severity = none # Change to be read-only by removing the property setter
|
|
dotnet_diagnostic.CA2249.severity = suggestion # Consider using 'Contains' method instead of 'IndexOf' method
|
|
dotnet_diagnostic.CA2252.severity = none # Requires preview
|
|
dotnet_diagnostic.CA2253.severity = none # Named placeholders in the logging message template should not be comprised of only numeric characters
|
|
dotnet_diagnostic.CA2253.severity = none # Named placeholders in the logging message template should not be comprised of only numeric characters
|
|
dotnet_diagnostic.CA2263.severity = suggestion # Use generic overload
|
|
dotnet_diagnostic.CA5394.severity = none # Do not use insecure sources of randomness
|
|
|
|
dotnet_diagnostic.VSTHRD003.severity = none # Waiting on thread from another context
|
|
dotnet_diagnostic.VSTHRD103.severity = none # Use async equivalent; analyzer is currently noisy
|
|
dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave
|
|
|
|
dotnet_diagnostic.xUnit1004.severity = none # Test methods should not be skipped. Remove the Skip property to start running the test again.
|
|
dotnet_diagnostic.xUnit1042.severity = none # Untyped data rows
|
|
|
|
dotnet_diagnostic.RCS1032.severity = none # Remove redundant parentheses.
|
|
dotnet_diagnostic.RCS1074.severity = none # Remove redundant constructor.
|
|
dotnet_diagnostic.RCS1140.severity = none # Add exception to documentation comment.
|
|
dotnet_diagnostic.RCS1141.severity = none # Add 'param' element to documentation comment.
|
|
dotnet_diagnostic.RCS1142.severity = none # Add 'typeparam' element to documentation comment.
|
|
dotnet_diagnostic.RCS1151.severity = none # Remove redundant cast.
|
|
dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter.
|
|
dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit value
|
|
dotnet_diagnostic.RCS1163.severity = none # Unused parameter 'foo'.
|
|
dotnet_diagnostic.RCS1181.severity = none # Convert comment to documentation comment.
|
|
dotnet_diagnostic.RCS1189.severity = none # Add region name to #endregion.
|
|
dotnet_diagnostic.RCS1205.severity = none # Order named arguments according to the order of parameters.
|
|
dotnet_diagnostic.RCS1212.severity = none # Remove redundant assignment.
|
|
dotnet_diagnostic.RCS1217.severity = none # Convert interpolated string to concatenation.
|
|
dotnet_diagnostic.RCS1222.severity = none # Merge preprocessor directives.
|
|
dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment.
|
|
dotnet_diagnostic.RCS1229.severity = none # Use async/await when necessary.
|
|
dotnet_diagnostic.RCS1234.severity = none # Enum duplicate value
|
|
dotnet_diagnostic.RCS1238.severity = none # Avoid nested ?: operators.
|
|
dotnet_diagnostic.RCS1241.severity = none # Implement IComparable when implementing IComparable<T>
|
|
dotnet_diagnostic.RCS1246.severity = none # Use element access
|
|
dotnet_diagnostic.RCS1261.severity = none # Resource can be disposed asynchronously
|
|
|
|
dotnet_diagnostic.IDE0010.severity = none # Populate switch
|
|
dotnet_diagnostic.IDE0021.severity = none # Use block body for constructors
|
|
dotnet_diagnostic.IDE0022.severity = none # Use block body for methods
|
|
dotnet_diagnostic.IDE0024.severity = none # Use block body for operator
|
|
dotnet_diagnostic.IDE0042.severity = none # Variable declaration can be deconstructed
|
|
dotnet_diagnostic.IDE0046.severity = none # if statement can be simplified
|
|
dotnet_diagnostic.IDE0056.severity = none # Indexing can be simplified
|
|
dotnet_diagnostic.IDE0057.severity = none # Substring can be simplified
|
|
dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter
|
|
dotnet_diagnostic.IDE0061.severity = none # Use block body for local function
|
|
dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary suppression.
|
|
dotnet_diagnostic.IDE0080.severity = none # Remove unnecessary suppression operator.
|
|
dotnet_diagnostic.IDE0100.severity = none # Remove unnecessary equality operator
|
|
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure
|
|
dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace
|
|
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
|
|
dotnet_diagnostic.IDE0305.severity = none # ToList can be simplified
|
|
dotnet_diagnostic.IDE0330.severity = none # Use 'System.Threading.Lock'
|
|
|
|
# Testing
|
|
dotnet_diagnostic.Moq1400.severity = none # Explicitly choose a mocking behavior instead of relying on the default (Loose) behavior
|
|
|
|
# Resharper disabled rules: https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html#CodeSmell
|
|
resharper_not_resolved_in_text_highlighting = none # Disable Resharper's "Not resolved in text" highlighting
|
|
resharper_check_namespace_highlighting = none # Disable Resharper's "Check namespace" highlighting
|
|
resharper_object_creation_as_statement_highlighting = none # Disable Resharper's "Object creation as statement" highlighting
|
|
|
|
###############################
|
|
# Naming Conventions #
|
|
###############################
|
|
|
|
# Styles
|
|
|
|
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
|
|
|
dotnet_naming_style.camel_case_style.capitalization = camel_case
|
|
|
|
dotnet_naming_style.static_underscored.capitalization = camel_case
|
|
dotnet_naming_style.static_underscored.required_prefix = s_
|
|
|
|
dotnet_naming_style.underscored.capitalization = camel_case
|
|
dotnet_naming_style.underscored.required_prefix = _
|
|
|
|
dotnet_naming_style.uppercase_with_underscore_separator.capitalization = all_upper
|
|
dotnet_naming_style.uppercase_with_underscore_separator.word_separator = _
|
|
|
|
dotnet_naming_style.end_in_async.required_prefix =
|
|
dotnet_naming_style.end_in_async.required_suffix = Async
|
|
dotnet_naming_style.end_in_async.capitalization = pascal_case
|
|
dotnet_naming_style.end_in_async.word_separator =
|
|
|
|
# Symbols
|
|
|
|
dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
|
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
|
|
dotnet_naming_symbols.constant_fields.required_modifiers = const
|
|
|
|
dotnet_naming_symbols.local_constant.applicable_kinds = local
|
|
dotnet_naming_symbols.local_constant.applicable_accessibilities = *
|
|
dotnet_naming_symbols.local_constant.required_modifiers = const
|
|
|
|
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
|
|
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
|
|
dotnet_naming_symbols.private_static_fields.required_modifiers = static
|
|
|
|
dotnet_naming_symbols.private_fields.applicable_kinds = field
|
|
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
|
|
|
|
dotnet_naming_symbols.any_async_methods.applicable_kinds = method
|
|
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
|
|
dotnet_naming_symbols.any_async_methods.required_modifiers = async
|
|
|
|
# Rules
|
|
|
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
|
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
|
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error
|
|
|
|
dotnet_naming_rule.local_constant_should_be_pascal_case.symbols = local_constant
|
|
dotnet_naming_rule.local_constant_should_be_pascal_case.style = pascal_case_style
|
|
dotnet_naming_rule.local_constant_should_be_pascal_case.severity = error
|
|
|
|
dotnet_naming_rule.private_static_fields_underscored.symbols = private_static_fields
|
|
dotnet_naming_rule.private_static_fields_underscored.style = static_underscored
|
|
dotnet_naming_rule.private_static_fields_underscored.severity = error
|
|
|
|
dotnet_naming_rule.private_fields_underscored.symbols = private_fields
|
|
dotnet_naming_rule.private_fields_underscored.style = underscored
|
|
dotnet_naming_rule.private_fields_underscored.severity = error
|
|
|
|
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
|
|
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
|
|
dotnet_naming_rule.async_methods_end_in_async.severity = error
|
|
|
|
###############################
|
|
# C# Coding Conventions #
|
|
###############################
|
|
|
|
# var preferences
|
|
csharp_style_var_for_built_in_types = false:none
|
|
csharp_style_var_when_type_is_apparent = false:none
|
|
csharp_style_var_elsewhere = false:none
|
|
# Expression-bodied members
|
|
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
|
|
# Pattern matching preferences
|
|
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
|
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
|
# Null-checking preferences
|
|
csharp_style_throw_expression = true:suggestion
|
|
csharp_style_conditional_delegate_call = true:suggestion
|
|
# Modifier preferences
|
|
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
|
|
# Expression-level preferences
|
|
csharp_prefer_braces = true:error
|
|
csharp_style_deconstructed_variable_declaration = true:suggestion
|
|
csharp_prefer_simple_default_expression = true:suggestion
|
|
csharp_style_prefer_local_over_anonymous_function = true:error
|
|
csharp_style_inlined_variable_declaration = true:suggestion
|
|
|
|
###############################
|
|
# C# Formatting Rules #
|
|
###############################
|
|
|
|
# New line preferences
|
|
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 = false # Does not work with resharper, forcing code to be on long lines instead of wrapping
|
|
csharp_new_line_before_members_in_anonymous_types = true
|
|
csharp_new_line_between_query_expression_clauses = true
|
|
# Indentation preferences
|
|
csharp_indent_braces = false
|
|
csharp_indent_case_contents = true
|
|
csharp_indent_case_contents_when_block = false
|
|
csharp_indent_switch_labels = true
|
|
csharp_indent_labels = flush_left
|
|
# Space preferences
|
|
csharp_space_after_cast = false
|
|
csharp_space_after_keywords_in_control_flow_statements = true
|
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
|
csharp_space_between_parentheses = false
|
|
csharp_space_before_colon_in_inheritance_clause = true
|
|
csharp_space_after_colon_in_inheritance_clause = true
|
|
csharp_space_around_binary_operators = before_and_after
|
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
|
# Wrapping preferences
|
|
csharp_preserve_single_line_statements = true
|
|
csharp_preserve_single_line_blocks = true
|
|
csharp_using_directive_placement = outside_namespace:warning
|
|
csharp_prefer_simple_using_statement = true:suggestion
|
|
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_expression_bodied_lambdas = true:silent
|
|
csharp_style_expression_bodied_local_functions = false:silent
|
|
|
|
###############################
|
|
# Resharper Rules #
|
|
###############################
|
|
|
|
# Resharper disabled rules: https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html#CodeSmell
|
|
resharper_redundant_linebreak_highlighting = none # Disable Resharper's "Redundant line break" highlighting
|
|
resharper_missing_linebreak_highlighting = none # Disable Resharper's "Missing line break" highlighting
|
|
resharper_bad_empty_braces_line_breaks_highlighting = none # Disable Resharper's "Bad empty braces line breaks" highlighting
|
|
resharper_missing_indent_highlighting = none # Disable Resharper's "Missing indent" highlighting
|
|
resharper_missing_blank_lines_highlighting = none # Disable Resharper's "Missing blank lines" highlighting
|
|
resharper_wrong_indent_size_highlighting = none # Disable Resharper's "Wrong indent size" highlighting
|
|
resharper_bad_indent_highlighting = none # Disable Resharper's "Bad indent" highlighting
|
|
resharper_bad_expression_braces_line_breaks_highlighting = none # Disable Resharper's "Bad expression braces line breaks" highlighting
|
|
resharper_multiple_spaces_highlighting = none # Disable Resharper's "Multiple spaces" highlighting
|
|
resharper_bad_expression_braces_indent_highlighting = none # Disable Resharper's "Bad expression braces indent" highlighting
|
|
resharper_bad_control_braces_indent_highlighting = none # Disable Resharper's "Bad control braces indent" highlighting
|
|
resharper_bad_preprocessor_indent_highlighting = none # Disable Resharper's "Bad preprocessor indent" highlighting
|
|
resharper_redundant_blank_lines_highlighting = none # Disable Resharper's "Redundant blank lines" highlighting
|
|
resharper_multiple_statements_on_one_line_highlighting = none # Disable Resharper's "Multiple statements on one line" highlighting
|
|
resharper_bad_braces_spaces_highlighting = none # Disable Resharper's "Bad braces spaces" highlighting
|
|
resharper_outdent_is_off_prev_level_highlighting = none # Disable Resharper's "Outdent is off previous level" highlighting
|
|
resharper_bad_symbol_spaces_highlighting = none # Disable Resharper's "Bad symbol spaces" highlighting
|
|
resharper_bad_colon_spaces_highlighting = none # Disable Resharper's "Bad colon spaces" highlighting
|
|
resharper_bad_semicolon_spaces_highlighting = none # Disable Resharper's "Bad semicolon spaces" highlighting
|
|
resharper_bad_square_brackets_spaces_highlighting = none # Disable Resharper's "Bad square brackets spaces" highlighting
|
|
resharper_bad_parens_spaces_highlighting = none # Disable Resharper's "Bad parens spaces" highlighting
|
|
|
|
# Resharper enabled rules: https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html#CodeSmell
|
|
resharper_comment_typo_highlighting = suggestion # Resharper's "Comment typo" highlighting
|
|
resharper_redundant_using_directive_highlighting = warning # Resharper's "Redundant using directive" highlighting
|
|
resharper_inconsistent_naming_highlighting = warning # Resharper's "Inconsistent naming" highlighting
|
|
resharper_redundant_this_qualifier_highlighting = warning # Resharper's "Redundant 'this' qualifier" highlighting
|
|
resharper_arrange_this_qualifier_highlighting = warning # Resharper's "Arrange 'this' qualifier" highlighting
|
|
csharp_style_prefer_primary_constructors = true:suggestion
|
|
csharp_prefer_system_threading_lock = true:suggestion
|
|
csharp_style_prefer_simple_property_accessors = true:suggestion
|