# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022

root = true

############################################################################################################################################
# Visual Studio - editorconfig                                                                                                             #
# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022#supported-settings                  #
############################################################################################################################################

[*]

charset = utf-8
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# Not supported (see https://developercommunity.visualstudio.com/t/support-max-line-length-in-editorconfig-for-visual/567214)
max_line_length = 140

############################################################################################################################################
# Editor Guidelines                                                                                                                        #
# https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelines                                                      #
############################################################################################################################################

[*]

guidelines = 140
guidelines_style = 1px dotted red
dotnet_diagnostic.CA1047.severity = warning

############################################################################################################################################
# .NET Source Code Analysis                                                                                                                #
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?view=vs-2022                                                 #
############################################################################################################################################

[*.{cs,vb}]

############################################################################################################################################
# .NET Code style rules                                                                                                                    #
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/?view=vs-2022                                             #
############################################################################################################################################

# Language rules ###########################################################################################################################

# 'this.' and 'Me.' qualifiers #######################################
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent

# Remove this or Me qualification
dotnet_diagnostic.IDE0003.severity = warning

# Add this or Me qualification
dotnet_diagnostic.IDE0009.severity = warning

# Use language keywords for types ####################################
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent

# Use language keywords instead of framework type names for type references
dotnet_diagnostic.IDE0049.severity = error

# Modifier preferences ###############################################
dotnet_style_require_accessibility_modifiers = always:silent
dotnet_style_readonly_field = false:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
csharp_prefer_static_local_function = true:suggestion

# Order modifiers
dotnet_diagnostic.IDE0036.severity = warning

# Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = warning

# Add readonly modifier
dotnet_diagnostic.IDE0044.severity = none

# Make local function static
dotnet_diagnostic.IDE0062.severity = error

# Make struct fields writable
dotnet_diagnostic.IDE0064.severity = warning

# Parentheses preferences ############################################
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent

# Remove unnecessary parentheses
dotnet_diagnostic.IDE0047.severity = warning

# Add parentheses for clarity
dotnet_diagnostic.IDE0048.severity = 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_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion

# Add missing cases to switch statement
dotnet_diagnostic.IDE0010.severity = suggestion

# Use object initializers
dotnet_diagnostic.IDE0017.severity = warning

# Inline variable declaration
dotnet_diagnostic.IDE0018.severity = warning

# Use collection initializers
dotnet_diagnostic.IDE0028.severity = warning

# Use auto property
dotnet_diagnostic.IDE0032.severity = warning

# Use explicitly provided tuple name
dotnet_diagnostic.IDE0033.severity = error

# Simplify 'default' expression
dotnet_diagnostic.IDE0034.severity = warning

# Use inferred member name
dotnet_diagnostic.IDE0037.severity = warning

# Use local function instead of lambda
dotnet_diagnostic.IDE0039.severity = warning
csharp_style_prefer_local_over_anonymous_function = true:suggestion

# Deconstruct variable declaration
dotnet_diagnostic.IDE0042.severity = warning

# Use conditional expression for assignment
dotnet_diagnostic.IDE0045.severity = silent

# Use conditional expression for return
dotnet_diagnostic.IDE0046.severity = silent

# Convert anonymous type to tuple
dotnet_diagnostic.IDE0050.severity = silent

# Use compound assignment
dotnet_diagnostic.IDE0054.severity = warning

# Use index operator
dotnet_diagnostic.IDE0056.severity = warning

# Use range operator
dotnet_diagnostic.IDE0057.severity = suggestion

# Use 'System.HashCode.Combine'
dotnet_diagnostic.IDE0070.severity = error

# Simplify interpolation
dotnet_diagnostic.IDE0071.severity = warning

# Add missing cases to switch expression
dotnet_diagnostic.IDE0072.severity = none

# Use coalesce compound assignment
dotnet_diagnostic.IDE0074.severity = warning

# Simplify conditional expression
dotnet_diagnostic.IDE0075.severity = warning

# Convert typeof to nameof
dotnet_diagnostic.IDE0082.severity = warning

# Simplify new expression
dotnet_diagnostic.IDE0090.severity = warning

# IDE0150: Prefer null check over type check
csharp_style_prefer_null_check_over_type_check = true:suggestion
# IDE0180: Use tuple to swap values
csharp_style_prefer_tuple_swap = true:suggestion

# New line preferences #################################

# IDE2001
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent

# IDE2002
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent

# IDE2004
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent

csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent

# Null-checking preferences ##########################################
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Use throw expression
dotnet_diagnostic.IDE0016.severity = warning

# Use coalesce expression (non-nullable types)
dotnet_diagnostic.IDE0029.severity = warning

# Use coalesce expression (nullable types)
dotnet_diagnostic.IDE0030.severity = warning

# Use null propagation
dotnet_diagnostic.IDE0031.severity = warning

# Use is null check
dotnet_diagnostic.IDE0041.severity = warning

# Use conditional delegate call
dotnet_diagnostic.IDE0105.severity = warning

# 'var' preferences ##################################################
csharp_style_var_when_type_is_apparent = false:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_elsewhere = false:silent

# Use 'var' instead of explicit type
dotnet_diagnostic.IDE0007.severity = warning

# Use explicit type instead of 'var'
dotnet_diagnostic.IDE0008.severity = warning

# 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 = 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
csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion
csharp_style_expression_bodied_local_functions = false:silent

# Use expression body for constructors
dotnet_diagnostic.IDE0021.severity = none

# Use expression body for methods
dotnet_diagnostic.IDE0022.severity = none

# Use expression body for operators
dotnet_diagnostic.IDE0023.severity = none

# Use expression body for operators
dotnet_diagnostic.IDE0024.severity = warning

# Use expression body for properties
dotnet_diagnostic.IDE0025.severity = warning

# Use expression body for indexers
dotnet_diagnostic.IDE0026.severity = warning

# Use expression body for accessors
dotnet_diagnostic.IDE0027.severity = warning

# Use expression body for lambdas
dotnet_diagnostic.IDE0053.severity = warning

# Use expression body for local functions
dotnet_diagnostic.IDE0061.severity = warning

# 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
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion

# Use pattern matching to avoid 'as' followed by a 'null' check
dotnet_diagnostic.IDE0019.severity = warning

# Use pattern matching to avoid 'is' check followed by a cast
dotnet_diagnostic.IDE0020.severity = warning

# Use pattern matching to avoid 'is' check followed by a cast
dotnet_diagnostic.IDE0038.severity = warning

# Use switch expression
dotnet_diagnostic.IDE0066.severity = warning

# Use pattern matching
dotnet_diagnostic.IDE0078.severity = warning

# Use pattern matching (not operator)
dotnet_diagnostic.IDE0083.severity = warning

# Use pattern matching (IsNot operator)
dotnet_diagnostic.IDE0084.severity = warning

# Code block preferences #############################################
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = true:suggestion
# IDE0210: Convert to top-level statements
csharp_style_prefer_top_level_statements = true:silent

# Add braces
dotnet_diagnostic.IDE0011.severity = warning

# Use simple 'using' statement
dotnet_diagnostic.IDE0063.severity = warning

# 'using' directive preferences ######################################
csharp_using_directive_placement = outside_namespace:silent

# 'using' directive placement
dotnet_diagnostic.IDE0065.severity = warning

# File header preferences ############################################

# Require file header
dotnet_diagnostic.IDE0073.severity = none

# Unnecessary code rules ###################################################################################################################
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
dotnet_code_quality_unused_parameters = all:suggestion
dotnet_remove_unnecessary_suppression_exclusions = none

# Simplify name
dotnet_diagnostic.IDE0001.severity = warning

# Simplify member access
dotnet_diagnostic.IDE0002.severity = warning

# Remove unnecessary cast
dotnet_diagnostic.IDE0004.severity = warning

# Remove unnecessary import
dotnet_diagnostic.IDE0005.severity = warning

# Remove unreachable code
dotnet_diagnostic.IDE0035.severity = warning

# Remove unused private member
dotnet_diagnostic.IDE0051.severity = warning

# Remove unread private member
dotnet_diagnostic.IDE0052.severity = warning

# Remove unused expression value
dotnet_diagnostic.IDE0058.severity = silent

# Remove unnecessary value assignment
dotnet_diagnostic.IDE0059.severity = warning

# Remove unused parameter
dotnet_diagnostic.IDE0060.severity = warning

# Remove unnecessary suppression
dotnet_diagnostic.IDE0079.severity = warning

# Remove unnecessary suppression operator
dotnet_diagnostic.IDE0080.severity = warning

# Remove ByVal
dotnet_diagnostic.IDE0081.severity = warning

# Remove unnecessary equality operator
dotnet_diagnostic.IDE0100.severity = warning

# Remove unnecessary discard
dotnet_diagnostic.IDE0110.severity = warning

# Simplify object creation
dotnet_diagnostic.IDE0140.severity = warning

# IDE0200: Remove unnecessary lambda expression
csharp_style_prefer_method_group_conversion = true:silent

# Miscellaneous rules #####################################################################################################################

# Remove invalid global 'SuppressMessageAttribute'
dotnet_diagnostic.IDE0076.severity = warning

# Avoid legacy format target in global 'SuppressMessageAttribute'
dotnet_diagnostic.IDE0077.severity = warning

# IDE0230: Use UTF-8 string literal
csharp_style_prefer_utf8_string_literals = true:suggestion

# IDE0251: Member can be made 'readonly'
csharp_style_prefer_readonly_struct_member = true:suggestion

# IDE0250: Struct can be made 'readonly'
csharp_style_prefer_readonly_struct = true:suggestion

# Formatting ############################################################################################################################

# Organize usings
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# Namespace options
dotnet_style_namespace_match_folder = true:suggestion
# - Must be block_scoped as long as Visual Studio 2019 has to be supported.
csharp_style_namespace_declarations = block_scoped:silent

# New-line options
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
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents_when_block = false

# Spacing options
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
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_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_after_comma = true
csharp_space_before_comma = false
csharp_space_after_dot = false
csharp_space_before_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_semicolon_in_for_statement = false
csharp_space_around_declaration_statements = false
csharp_space_before_open_square_brackets = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false

# Wrap options
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true

# Fix formatting
dotnet_diagnostic.IDE0055.severity = warning

# Convert to block scoped namespace
dotnet_diagnostic.IDE0160.severity = none

# Convert to file-scoped namespace
dotnet_diagnostic.IDE0161.severity = none

# Naming rules ############################################################################################################################

# Naming rules with symbols -------------------------------------------------------------------------------------------

# non-private class must be pascal case
dotnet_naming_rule.class.symbols                               = class_symbols
dotnet_naming_rule.class.style = pascal_case_style
dotnet_naming_rule.class.severity = warning
dotnet_naming_symbols.class_symbols.applicable_kinds           = class
dotnet_naming_symbols.class_symbols.applicable_accessibilities = public,internal,private,protected,protected_internal

# non-private interface must be pascal case with 'I' prefix
dotnet_naming_rule.interface.symbols                               = interface_symbols
dotnet_naming_rule.interface.style = begins_with_capitalized_i_then_pascal_case_style
dotnet_naming_rule.interface.severity = warning
dotnet_naming_symbols.interface_symbols.applicable_kinds           = interface
dotnet_naming_symbols.interface_symbols.applicable_accessibilities = public,internal,private,protected,protected_internal

# non-private struct must be pascal case
dotnet_naming_rule.struct.symbols                               = struct_symbols
dotnet_naming_rule.struct.style = pascal_case_style
dotnet_naming_rule.struct.severity = warning
dotnet_naming_symbols.struct_symbols.applicable_kinds           = struct
dotnet_naming_symbols.struct_symbols.applicable_accessibilities = public,internal,private,protected,protected_internal

# non-private enum must be pascal case
dotnet_naming_rule.enum.symbols                               = enum_symbols
dotnet_naming_rule.enum.style = pascal_case_style
dotnet_naming_rule.enum.severity = warning
dotnet_naming_symbols.enum_symbols.applicable_kinds           = enum
dotnet_naming_symbols.enum_symbols.applicable_accessibilities = public,internal,private,protected,protected_internal

# async private method must be camel case
dotnet_naming_rule.async_private_method.symbols                               = async_private_method_symbols
dotnet_naming_rule.async_private_method.style = camel_case_async_style
dotnet_naming_rule.async_private_method.severity = warning
dotnet_naming_symbols.async_private_method_symbols.applicable_kinds           = method
dotnet_naming_symbols.async_private_method_symbols.applicable_accessibilities = private
dotnet_naming_symbols.async_private_method_symbols.required_modifiers         = async

# private method must be camel case
dotnet_naming_rule.private_method.symbols                               = private_method_symbols
dotnet_naming_rule.private_method.style = camel_case_style
dotnet_naming_rule.private_method.severity = warning
dotnet_naming_symbols.private_method_symbols.applicable_kinds           = method
dotnet_naming_symbols.private_method_symbols.applicable_accessibilities = private

# non-private field must be pascal case
dotnet_naming_rule.other_field.symbols                               = other_field_symbols
dotnet_naming_rule.other_field.style = pascal_case_style
dotnet_naming_rule.other_field.severity = warning
dotnet_naming_symbols.other_field_symbols.applicable_kinds           = field
dotnet_naming_symbols.other_field_symbols.applicable_accessibilities = public,internal,protected,protected_internal

# private constant must be upper case with '_' word separators
dotnet_naming_rule.private_constant.symbols                               = private_constant_symbols
dotnet_naming_rule.private_constant.style = uppercase_with_underscore_separator
dotnet_naming_rule.private_constant.severity = suggestion
dotnet_naming_symbols.private_constant_symbols.applicable_kinds           = field
dotnet_naming_symbols.private_constant_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_constant_symbols.required_modifiers         = const

# public constant must be upper case with '_' word separators
dotnet_naming_rule.constants_must_be_uppercase.symbols                 = public_constants
dotnet_naming_rule.constants_must_be_uppercase.style = uppercase_with_underscore_separator
dotnet_naming_rule.constants_must_be_uppercase.severity = suggestion
dotnet_naming_symbols.public_constants.applicable_kinds                = field
dotnet_naming_symbols.public_constants.applicable_accessibilities      = *
dotnet_naming_symbols.public_constants.required_modifiers              = const

# private field must be camel case with '_' prefix
dotnet_naming_rule.private_field.symbols                               = private_field_symbols
dotnet_naming_rule.private_field.style = begins_with_underscore_then_camel_case_style
dotnet_naming_rule.private_field.severity = warning
dotnet_naming_symbols.private_field_symbols.applicable_kinds           = field
dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private

# private event must be camel case with '_' prefix
dotnet_naming_rule.private_event.symbols                               = private_event_symbols
dotnet_naming_rule.private_event.style = begins_with_underscore_then_camel_case_style
dotnet_naming_rule.private_event.severity = warning
dotnet_naming_symbols.private_event_symbols.applicable_kinds           = event
dotnet_naming_symbols.private_event_symbols.applicable_accessibilities = private

# parameter must be camel case
dotnet_naming_rule.parameter.symbols                               = parameter_symbols
dotnet_naming_rule.parameter.style = camel_case_style
dotnet_naming_rule.parameter.severity = warning
dotnet_naming_symbols.parameter_symbols.applicable_kinds           = parameter
dotnet_naming_symbols.parameter_symbols.applicable_accessibilities = public,internal,private,protected,protected_internal

# non-private events must be pascal case
dotnet_naming_rule.other_events.symbols                               = other_events_symbols
dotnet_naming_rule.other_events.style = pascal_case_style
dotnet_naming_rule.other_events.severity = warning
dotnet_naming_symbols.other_events_symbols.applicable_kinds           = event
dotnet_naming_symbols.other_events_symbols.applicable_accessibilities = public,internal,protected,protected_internal

# private property must be pascal case
dotnet_naming_rule.private_property.symbols                               = private_property_symbols
dotnet_naming_rule.private_property.style = pascal_case_style
dotnet_naming_rule.private_property.severity = warning
dotnet_naming_symbols.private_property_symbols.applicable_kinds           = property
dotnet_naming_symbols.private_property_symbols.applicable_accessibilities = private

# non-private property must be pascal case
dotnet_naming_rule.other_property.symbols                               = other_property_symbols
dotnet_naming_rule.other_property.style = pascal_case_style
dotnet_naming_rule.other_property.severity = warning
dotnet_naming_symbols.other_property_symbols.applicable_kinds           = property
dotnet_naming_symbols.other_property_symbols.applicable_accessibilities = public,internal,protected,protected_internal

# non-private constant must be upper case with '_' word separators
dotnet_naming_rule.other_constant.symbols                               = other_constant_symbols
dotnet_naming_rule.other_constant.style = uppercase_with_underscore_separator
dotnet_naming_rule.other_constant.severity = suggestion
dotnet_naming_symbols.other_constant_symbols.applicable_kinds           = field
dotnet_naming_symbols.other_constant_symbols.applicable_accessibilities = public,internal,protected,protected_internal
dotnet_naming_symbols.other_constant_symbols.required_modifiers         = const

# async non-private method must be pascal case
dotnet_naming_rule.async_method.symbols                               = async_method_symbols
dotnet_naming_rule.async_method.style = pascal_case_async_style
dotnet_naming_rule.async_method.severity = warning
dotnet_naming_symbols.async_method_symbols.applicable_kinds           = method
dotnet_naming_symbols.async_method_symbols.applicable_accessibilities = public,internal,protected,protected_internal
dotnet_naming_symbols.async_method_symbols.required_modifiers         = async

# non-private method must be pascal case
dotnet_naming_rule.other_method.symbols                               = other_method_symbols
dotnet_naming_rule.other_method.style = pascal_case_style
dotnet_naming_rule.other_method.severity = warning
dotnet_naming_symbols.other_method_symbols.applicable_kinds           = method
dotnet_naming_symbols.other_method_symbols.applicable_accessibilities = public,internal,protected,protected_internal

# non-private delegate must be pascal case
dotnet_naming_rule.other_delegate.symbols                               = other_delegate_symbols
dotnet_naming_rule.other_delegate.style = pascal_case_style
dotnet_naming_rule.other_delegate.severity = warning
dotnet_naming_symbols.other_delegate_symbols.applicable_kinds           = delegate
dotnet_naming_symbols.other_delegate_symbols.applicable_accessibilities = public,internal,protected,protected_internal

# static readonly fields must be upper case with '_' word separators (like constants)
dotnet_naming_rule.static_readonly_fields_title_case.symbols            = static_readonly_fields
dotnet_naming_rule.static_readonly_fields_title_case.style = uppercase_with_underscore_separator
dotnet_naming_rule.static_readonly_fields_title_case.severity = warning
dotnet_naming_symbols.static_readonly_fields.applicable_kinds           = field
dotnet_naming_symbols.static_readonly_fields.applicable_accessibilities = public,private
dotnet_naming_symbols.static_readonly_fields.required_modifiers         = readonly,static
# Naming Styles ----------------------------------------------------------------------------------
---------------------

# pascal_case_style
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# pascal_case_async_style
dotnet_naming_style.pascal_case_async_style.capitalization = pascal_case
dotnet_naming_style.pascal_case_async_style.required_suffix = Async

# camel_case_style 
dotnet_naming_style.camel_case_style.capitalization = camel_case

# camel_case_async_style 
dotnet_naming_style.camel_case_async_style.capitalization = camel_case
dotnet_naming_style.camel_case_async_style.required_suffix = Async

# begins_with_capitalized_i_then_pascal_case_style
dotnet_naming_style.begins_with_capitalized_i_then_pascal_case_style.capitalization = pascal_case
dotnet_naming_style.begins_with_capitalized_i_then_pascal_case_style.required_prefix = I

# begins_with_underscore_then_camel_case_style
dotnet_naming_style.begins_with_underscore_then_camel_case_style.capitalization = camel_case
dotnet_naming_style.begins_with_underscore_then_camel_case_style.required_prefix = _

# uppercase_with_underscore_separator style
dotnet_naming_style.uppercase_with_underscore_separator.capitalization = all_upper
dotnet_naming_style.uppercase_with_underscore_separator.word_separator = _

# Naming styles
dotnet_diagnostic.IDE1006.severity = warning

###########################################################################################################################################
# .NET Code quality rules                                                                                                                 #
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/?view=vs-2022                                          #
###########################################################################################################################################

# Design ##################################################################################################################################

# CA1000: Do not declare static members on generic types
dotnet_diagnostic.CA1000.severity = warning

# CA1001: Types that own disposable fields should be disposable
dotnet_diagnostic.CA1001.severity = warning

# CA1002: Do not expose generic lists
dotnet_diagnostic.CA1002.severity = warning

# CA1003: Use generic event handler instances
dotnet_diagnostic.CA1003.severity = error

# CA1005: Avoid excessive parameters on generic types
dotnet_diagnostic.CA1005.severity = error

# CA1008: Enums should have zero value
dotnet_diagnostic.CA1008.severity = warning

# CA1010: Collections should implement generic interface
dotnet_diagnostic.CA1010.severity = warning

# CA1012: Abstract types should not have constructors
dotnet_diagnostic.CA1012.severity = warning

# CA1014: Mark assemblies with CLSCompliant
dotnet_diagnostic.CA1014.severity = error

# CA1016: Mark assemblies with assembly version
dotnet_diagnostic.CA1016.severity = warning

# CA1017: Mark assemblies with ComVisible
dotnet_diagnostic.CA1017.severity = error

# CA1018: Mark attributes with AttributeUsageAttribute
dotnet_diagnostic.CA1018.severity = error

# CA1019: Define accessors for attribute arguments
dotnet_diagnostic.CA1019.severity = error

# CA1021: Avoid out parameters
dotnet_diagnostic.CA1021.severity = suggestion

# CA1024: Use properties where appropriate
dotnet_diagnostic.CA1024.severity = warning

# CA1027: Mark enums with FlagsAttribute
dotnet_diagnostic.CA1027.severity = warning

# CA1028: Enum Storage should be Int32
dotnet_diagnostic.CA1028.severity = error

# CA1030: Use events where appropriate
dotnet_diagnostic.CA1030.severity = error

# CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = none

# CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1032.severity = warning

# CA1033: Interface methods should be callable by child types
dotnet_diagnostic.CA1033.severity = error

# CA1034: Nested types should not be visible
dotnet_diagnostic.CA1034.severity = warning

# CA1036: Override methods on comparable types
dotnet_diagnostic.CA1036.severity = warning

# CA1040: Avoid empty interfaces
dotnet_diagnostic.CA1040.severity = error

# CA1041: Provide ObsoleteAttribute message
dotnet_diagnostic.CA1041.severity = error

# CA1043: Use integral or string argument for indexers
dotnet_diagnostic.CA1043.severity = error

# CA1044: Properties should not be write only
dotnet_diagnostic.CA1044.severity = warning

# CA1045: Do not pass types by reference
dotnet_diagnostic.CA1045.severity = warning

# CA1046: Do not overload equality operator on reference types
dotnet_diagnostic.CA1046.severity = warning

# CA1047: Do not declare protected member in sealed type
dotnet_diagnostic.CA1047.severity = error

# CA1050: Declare types in namespaces
dotnet_diagnostic.CA1050.severity = error

# CA1051: Do not declare visible instance fields
dotnet_diagnostic.CA1051.severity = warning

# CA1052: Static holder types should be sealed
dotnet_diagnostic.CA1052.severity = warning

# CA1053: Static holder types should not have constructors
dotnet_diagnostic.CA1053.severity = error

# CA1054: URI parameters should not be strings
dotnet_diagnostic.CA1054.severity = warning

# CA1055: URI return values should not be strings
dotnet_diagnostic.CA1055.severity = warning

# CA1056: URI properties should not be strings
dotnet_diagnostic.CA1056.severity = warning

# CA1058: Types should not extend certain base types
dotnet_diagnostic.CA1058.severity = error

# CA1060: Move P/Invokes to NativeMethods class
dotnet_diagnostic.CA1060.severity = error

# CA1061: Do not hide base class methods
dotnet_diagnostic.CA1061.severity = error

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = warning

# CA1063: Implement IDisposable correctly
dotnet_diagnostic.CA1063.severity = error

# CA1064: Exceptions should be public
dotnet_diagnostic.CA1064.severity = error

# CA1065: Do not raise exceptions in unexpected locations
dotnet_diagnostic.CA1065.severity = warning

# CA1066: Implement IEquatable when overriding Equals
dotnet_diagnostic.CA1066.severity = error

# CA1067: Override Object.Equals(object) when implementing IEquatable<T>
dotnet_diagnostic.CA1067.severity = warning

# CA1068: CancellationToken parameters must come last
dotnet_diagnostic.CA1068.severity = error

# CA1069: Enums should not have duplicate values
dotnet_diagnostic.CA1069.severity = warning

# CA1070: Do not declare event fields as virtual
dotnet_diagnostic.CA1070.severity = warning

# Documentation ###########################################################################################################################

# CA1200: Avoid using cref tags with a prefix
dotnet_diagnostic.CA1200.severity = warning

# Globalization ###########################################################################################################################

# CA1303: Do not pass literals as localized parameters
# - No localization planned
dotnet_diagnostic.CA1303.severity = none

# CA1304: Specify CultureInfo
dotnet_diagnostic.CA1304.severity = warning

# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = warning

# CA1307: Specify StringComparison
dotnet_diagnostic.CA1307.severity = warning

# CA1308: Normalize strings to uppercase
dotnet_diagnostic.CA1308.severity = warning

# CA1309: Use ordinal StringComparison
dotnet_diagnostic.CA1309.severity = warning

# CA1310: Specify StringComparison for correctness
dotnet_diagnostic.CA1310.severity = warning

# CA2101: Specify marshaling for P/Invoke string arguments
dotnet_diagnostic.CA2101.severity = warning

# Portability and interoperability ########################################################################################################

# CA1401: P/Invokes should not be visible
dotnet_diagnostic.CA1401.severity = error

# CA1416: Validate platform compatibility
dotnet_diagnostic.CA1416.severity = error

# CA1417: Do not use 'OutAttribute' on string parameters for P/Invokes
dotnet_diagnostic.CA1417.severity = error

# CA1418: Use valid platform string
dotnet_diagnostic.CA1418.severity = error

# Maintainability #########################################################################################################################

# CA1501: Avoid excessive inheritance
dotnet_diagnostic.CA1501.severity = warning

# CA1502: Avoid excessive complexity
dotnet_diagnostic.CA1502.severity = warning

# CA1505: Avoid unmaintainable code
dotnet_diagnostic.CA1505.severity = warning

# CA1506: Avoid excessive class coupling
dotnet_diagnostic.CA1506.severity = warning

# CA1507: Use nameof in place of string
dotnet_diagnostic.CA1507.severity = warning

# CA1508: Avoid dead conditional code
dotnet_diagnostic.CA1508.severity = warning

# CA1509: Invalid entry in code metrics configuration file
dotnet_diagnostic.CA1509.severity = warning

# Naming ##################################################################################################################################

# CA1700: Do not name enum values 'Reserved'
dotnet_diagnostic.CA1700.severity = warning

# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = none

# CA1708: Identifiers should differ by more than case
dotnet_diagnostic.CA1708.severity = warning

# CA1710: Identifiers should have correct suffix
dotnet_diagnostic.CA1710.severity = warning

# CA1711: Identifiers should not have incorrect suffix
dotnet_diagnostic.CA1711.severity = warning

# CA1712: Do not prefix enum values with type name
dotnet_diagnostic.CA1712.severity = warning

# CA1713: Events should not have 'Before' or 'After' prefix
dotnet_diagnostic.CA1713.severity = warning

# CA1714: Flags enums should have plural names
dotnet_diagnostic.CA1714.severity = warning

# CA1715: Identifiers should have correct prefix
dotnet_diagnostic.CA1715.severity = warning

# CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = warning

# CA1717: Only FlagsAttribute enums should have plural names
dotnet_diagnostic.CA1717.severity = warning

# CA1720: Identifiers should not contain type names
dotnet_diagnostic.CA1720.severity = warning

# CA1721: Property names should not match get methods
dotnet_diagnostic.CA1721.severity = warning

# CA1724: Type names should not match namespaces
dotnet_diagnostic.CA1724.severity = warning

# CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = warning

# Performance #############################################################################################################################

# CA1802: Use literals where appropriate
dotnet_diagnostic.CA1802.severity = warning

# CA1805: Do not initialize unnecessarily
dotnet_diagnostic.CA1805.severity = warning

# CA1806: Do not ignore method results
dotnet_diagnostic.CA1806.severity = warning

# CA1810: Initialize reference type static fields inline
dotnet_diagnostic.CA1810.severity = error

# CA1812: Avoid uninstantiated internal classes
dotnet_diagnostic.CA1812.severity = warning

# CA1813: Avoid unsealed attributes
dotnet_diagnostic.CA1813.severity = error

# CA1814: Prefer jagged arrays over multidimensional
dotnet_diagnostic.CA1814.severity = warning

# CA1815: Override equals and operator equals on value types
dotnet_diagnostic.CA1815.severity = warning

# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = warning

# CA1820: Test for empty strings using string length
dotnet_diagnostic.CA1820.severity = warning

# CA1821: Remove empty finalizers
dotnet_diagnostic.CA1821.severity = error

# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = warning

# CA1823: Avoid unused private fields
dotnet_diagnostic.CA1823.severity = error

# CA1824: Mark assemblies with NeutralResourcesLanguageAttribute
dotnet_diagnostic.CA1824.severity = warning

# CA1825: Avoid zero-length array allocations.
dotnet_diagnostic.CA1825.severity = warning

# CA1826: Use property instead of Linq Enumerable method
dotnet_diagnostic.CA1826.severity = error

# CA1827: Do not use Count() or LongCount() when Any() can be used
dotnet_diagnostic.CA1827.severity = warning

# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
dotnet_diagnostic.CA1828.severity = error

# CA1829: Use Length/Count property instead of Enumerable.Count() method
dotnet_diagnostic.CA1829.severity = warning

# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
dotnet_diagnostic.CA1830.severity = warning

# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
dotnet_diagnostic.CA1831.severity = error

# CA1832: Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array
dotnet_diagnostic.CA1832.severity = error

# CA1833: Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memoty portion of an array
dotnet_diagnostic.CA1833.severity = error

# CA1834: Use StringBuilder.Append(char) for single character strings
dotnet_diagnostic.CA1834.severity = warning

# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
dotnet_diagnostic.CA1835.severity = error

# CA1836: Prefer IsEmpty over Count when available
dotnet_diagnostic.CA1836.severity = error

# CA1837: Use 'Environment.ProcessId' instead of 'Process.GetCurrentProcess().Id'
dotnet_diagnostic.CA1837.severity = error

# CA1838: Avoid 'StringBuilder' parameters for P/Invokes
dotnet_diagnostic.CA1838.severity = error

# CA1839 Use 'Environment.ProcessPath' instead of 'Process.GetCurrentProcess().MainModule.FileName'
dotnet_diagnostic.CA1839.severity = error

# CA1840 Use 'Environment.CurrentManagedThreadId' instead of 'Thread.CurrentThread.ManagedThreadId'
dotnet_diagnostic.CA1840.severity = error

# CA1841: Prefer Dictionary Contains methods
dotnet_diagnostic.CA1841.severity = warning

# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1844.severity = error

# CA1845: Use span-based 'string.Concat'
dotnet_diagnostic.CA1845.severity = error

# CA1846: Prefer AsSpan over Substring
dotnet_diagnostic.CA1846.severity = error

# CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1847.severity = error

# CA1849: Call async methods when in an async method
dotnet_diagnostic.CA1849.severity = error

# CA1850: Prefer static HashData method over ComputeHash
dotnet_diagnostic.CA1850.severity = error

# SingleFile ##############################################################################################################################

# IL3000 Avoid accessing Assembly file path when publishing as a single file
dotnet_diagnostic.IL3000.severity = error

# IL3001 Avoid accessing Assembly file path when publishing as a single file
dotnet_diagnostic.IL3001.severity = error

# IL3002: Avoid calling members annotated with 'RequiresAssemblyFilesAttribute' when publishing as a single file
dotnet_diagnostic.IL3002.severity = error

# Reliability #############################################################################################################################

# CA2000: Dispose objects before losing scope
dotnet_diagnostic.CA2000.severity = warning

# CA2002: Do not lock on objects with weak identity
dotnet_diagnostic.CA2002.severity = error

# CA2007: Do not directly await a Task
dotnet_diagnostic.CA2007.severity = warning

# CA2008: Do not create tasks without passing a TaskScheduler
dotnet_diagnostic.CA2008.severity = warning

# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value
dotnet_diagnostic.CA2009.severity = error

# CA2011: Do not assign property within its setter
dotnet_diagnostic.CA2011.severity = error

# CA2012: Use ValueTasks correctly
dotnet_diagnostic.CA2012.severity = error

# CA2013: Do not use ReferenceEquals with value types
dotnet_diagnostic.CA2013.severity = error

# CA2014: Do not use stackalloc in loops
dotnet_diagnostic.CA2014.severity = error

# CA2015: Do not define finalizers for types derived from MemoryManager<T>
dotnet_diagnostic.CA2015.severity = error

# CA2016: Forward the 'CancellationToken' parameter to methods that take one
dotnet_diagnostic.CA2016.severity = error

# CA2018: The count argument to Buffer.BlockCopy should specify the number of bytes to copy
dotnet_diagnostic.CA2018.severity = error

# Security ################################################################################################################################

# CA2100: Review SQL queries for security vulnerabilities
dotnet_diagnostic.CA2100.severity = error

# CA2109: Review visible event handlers
dotnet_diagnostic.CA2109.severity = warning

# CA2119: Seal methods that satisfy private interfaces
dotnet_diagnostic.CA2119.severity = error

# CA2153: Avoid handling Corrupted State Exceptions
dotnet_diagnostic.CA2153.severity = error

# CA2300: Do not use insecure deserializer BinaryFormatter
dotnet_diagnostic.CA2300.severity = error

# CA2301: Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder
dotnet_diagnostic.CA2301.severity = error

# CA2302: Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize
dotnet_diagnostic.CA2302.severity = error

# CA2305: Do not use insecure deserializer LosFormatter
dotnet_diagnostic.CA2305.severity = error

# CA2310: Do not use insecure deserializer NetDataContractSerializer
dotnet_diagnostic.CA2310.severity = error

# CA2311: Do not deserialize without first setting NetDataContractSerializer.Binder
dotnet_diagnostic.CA2311.severity = error

# CA2312: Ensure NetDataContractSerializer.Binder is set before deserializing
dotnet_diagnostic.CA2312.severity = error

# CA2315: Do not use insecure deserializer ObjectStateFormatter
dotnet_diagnostic.CA2315.severity = error

# CA2321: Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver
dotnet_diagnostic.CA2321.severity = error

# CA2322: Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver before deserializing
dotnet_diagnostic.CA2322.severity = error

# CA2326: Do not use TypeNameHandling values other than None
dotnet_diagnostic.CA2326.severity = error

# CA2327: Do not use insecure JsonSerializerSettings
dotnet_diagnostic.CA2327.severity = error

# CA2328: Ensure that JsonSerializerSettings are secure
dotnet_diagnostic.CA2328.severity = error

# CA2329: Do not deserialize with JsonSerializer using an insecure configuration
dotnet_diagnostic.CA2329.severity = error

# CA2330: Ensure that JsonSerializer has a secure configuration when deserializing
dotnet_diagnostic.CA2330.severity = error

# CA2350: Ensure DataTable.ReadXml()'s input is trusted
dotnet_diagnostic.CA2350.severity = error

# CA2351: Ensure DataSet.ReadXml()'s input is trusted
dotnet_diagnostic.CA2351.severity = error

# CA2352: Unsafe DataSet or DataTable in serializable type can be vulnerable to remote code execution attacks
dotnet_diagnostic.CA2352.severity = error

# CA2353: Unsafe DataSet or DataTable in serializable type
dotnet_diagnostic.CA2353.severity = error

# CA2354: Unsafe DataSet or DataTable in deserialized object graph can be vulnerable to remote code execution attacks
dotnet_diagnostic.CA2354.severity = error

# CA2355: Unsafe DataSet or DataTable type found in deserializable object graph
dotnet_diagnostic.CA2355.severity = error

# CA2356: Unsafe DataSet or DataTable type in web deserializable object graph
dotnet_diagnostic.CA2356.severity = error

# CA2361: Ensure autogenerated class containing DataSet.ReadXml() is not used with untrusted data
dotnet_diagnostic.CA2361.severity = error

# CA2362: Unsafe DataSet or DataTable in autogenerated serializable type can be vulnerable to remote code execution attacks
dotnet_diagnostic.CA2362.severity = error

# CA3001: Review code for SQL injection vulnerabilities
dotnet_diagnostic.CA3001.severity = error

# CA3002: Review code for XSS vulnerabilities
dotnet_diagnostic.CA3002.severity = warning

# CA3003: Review code for file path injection vulnerabilities
dotnet_diagnostic.CA3003.severity = warning

# CA3004: Review code for information disclosure vulnerabilities
dotnet_diagnostic.CA3004.severity = error

# CA3006: Review code for process command injection vulnerabilities
dotnet_diagnostic.CA3006.severity = error

# CA3007: Review code for open redirect vulnerabilities
dotnet_diagnostic.CA3007.severity = warning

# CA3008: Review code for XPath injection vulnerabilities
dotnet_diagnostic.CA3008.severity = error

# CA3009: Review code for XML injection vulnerabilities
dotnet_diagnostic.CA3009.severity = error

# CA3010: Review code for XAML injection vulnerabilities
dotnet_diagnostic.CA3010.severity = error

# CA3011: Review code for DLL injection vulnerabilities
dotnet_diagnostic.CA3011.severity = error

# CA3012: Review code for regex injection vulnerabilities
dotnet_diagnostic.CA3012.severity = error

# CA3061: Do Not Add Schema By URL
dotnet_diagnostic.CA3061.severity = error

# CA3075: Insecure DTD processing in XML
dotnet_diagnostic.CA3075.severity = warning

# CA3076: Insecure XSLT script processing.
dotnet_diagnostic.CA3076.severity = error

# CA3077: Insecure Processing in API Design, XmlDocument and XmlTextReader
dotnet_diagnostic.CA3077.severity = error

# CA3147: Mark Verb Handlers With Validate Antiforgery Token
dotnet_diagnostic.CA3147.severity = error

# CA5350: Do Not Use Weak Cryptographic Algorithms
dotnet_diagnostic.CA5350.severity = error

# CA5351: Do Not Use Broken Cryptographic Algorithms
dotnet_diagnostic.CA5351.severity = warning

# CA5358: Do Not Use Unsafe Cipher Modes
dotnet_diagnostic.CA5358.severity = error

# CA5359: Do Not Disable Certificate Validation
dotnet_diagnostic.CA5359.severity = error

# CA5360: Do Not Call Dangerous Methods In Deserialization
dotnet_diagnostic.CA5360.severity = error

# CA5361: Do Not Disable SChannel Use of Strong Crypto
dotnet_diagnostic.CA5361.severity = error

# CA5362: Potential reference cycle in deserialized object graph
dotnet_diagnostic.CA5362.severity = error

# CA5363: Do Not Disable Request Validation
dotnet_diagnostic.CA5363.severity = error

# CA5364: Do Not Use Deprecated Security Protocols
dotnet_diagnostic.CA5364.severity = error

# CA5365: Do Not Disable HTTP Header Checking
dotnet_diagnostic.CA5365.severity = error

# CA5366: Use XmlReader For DataSet Read Xml
dotnet_diagnostic.CA5366.severity = error

# CA5367: Do Not Serialize Types With Pointer Fields
dotnet_diagnostic.CA5367.severity = error

# CA5368: Set ViewStateUserKey For Classes Derived From Page
dotnet_diagnostic.CA5368.severity = warning

# CA5369: Use XmlReader For Deserialize
dotnet_diagnostic.CA5369.severity = error

# CA5370: Use XmlReader For Validating Reader
dotnet_diagnostic.CA5370.severity = error

# CA5371: Use XmlReader For Schema Read
dotnet_diagnostic.CA5371.severity = error

# CA5372: Use XmlReader For XPathDocument
dotnet_diagnostic.CA5372.severity = error

# CA5373: Do not use obsolete key derivation function
dotnet_diagnostic.CA5373.severity = error

# CA5374: Do Not Use XslTransform
dotnet_diagnostic.CA5374.severity = error

# CA5375: Do Not Use Account Shared Access Signature
dotnet_diagnostic.CA5375.severity = error

# CA5376: Use SharedAccessProtocol HttpsOnly
dotnet_diagnostic.CA5376.severity = error

# CA5377: Use Container Level Access Policy
dotnet_diagnostic.CA5377.severity = error

# CA5378: Do not disable ServicePointManagerSecurityProtocols
dotnet_diagnostic.CA5378.severity = error

# CA5379: Do Not Use Weak Key Derivation Function Algorithm
dotnet_diagnostic.CA5379.severity = warning

# CA5380: Do Not Add Certificates To Root Store
dotnet_diagnostic.CA5380.severity = error

# CA5381: Ensure Certificates Are Not Added To Root Store
dotnet_diagnostic.CA5381.severity = error

# CA5382: Use Secure Cookies In ASP.Net Core
dotnet_diagnostic.CA5382.severity = error

# CA5383: Ensure Use Secure Cookies In ASP.Net Core
dotnet_diagnostic.CA5383.severity = error

# CA5384: Do Not Use Digital Signature Algorithm (DSA)
dotnet_diagnostic.CA5384.severity = error

# CA5385: Use Rivest–Shamir–Adleman (RSA) Algorithm With Sufficient Key Size
dotnet_diagnostic.CA5385.severity = error

# CA5386: Avoid hardcoding SecurityProtocolType value
dotnet_diagnostic.CA5386.severity = error

# CA5387: Do Not Use Weak Key Derivation Function With Insufficient Iteration Count
dotnet_diagnostic.CA5387.severity = warning

# CA5388: Ensure Sufficient Iteration Count When Using Weak Key Derivation Function
dotnet_diagnostic.CA5388.severity = error

# CA5389: Do Not Add Archive Item's Path To The Target File System Path
dotnet_diagnostic.CA5389.severity = error

# CA5390: Do not hard-code encryption key
dotnet_diagnostic.CA5390.severity = error

# CA5391: Use antiforgery tokens in ASP.NET Core MVC controllers
dotnet_diagnostic.CA5391.severity = error

# CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes
dotnet_diagnostic.CA5392.severity = error

# CA5393: Do not use unsafe DllImportSearchPath value
dotnet_diagnostic.CA5393.severity = error

# CA5394: Do not use insecure randomness
dotnet_diagnostic.CA5394.severity = warning

# CA5395: Miss HttpVerb attribute for action methods
dotnet_diagnostic.CA5395.severity = error

# CA5396: Set HttpOnly to true for HttpCookie
dotnet_diagnostic.CA5396.severity = error

# CA5397: Do not use deprecated SslProtocols values
dotnet_diagnostic.CA5397.severity = error

# CA5398: Avoid hardcoded SslProtocols values
dotnet_diagnostic.CA5398.severity = error

# CA5399: HttpClients should enable certificate revocation list checks
dotnet_diagnostic.CA5399.severity = error

# CA5400: Ensure HttpClient certificate revocation list check is not disabled
dotnet_diagnostic.CA5400.severity = error

# CA5401: Do not use CreateEncryptor with non-default IV
dotnet_diagnostic.CA5401.severity = warning

# CA5402: Use CreateEncryptor with the default IV
dotnet_diagnostic.CA5402.severity = error

# CA5403: Do not hard-code certificate
dotnet_diagnostic.CA5403.severity = error

# CA5404: Do not disable token validation checks
dotnet_diagnostic.CA5404.severity = warning

# CA5405: Do not always skip token validation in delegates
dotnet_diagnostic.CA5405.severity = error

# Usage ###################################################################################################################################

# CA1801: Review unused parameters
dotnet_diagnostic.CA1801.severity = warning

# CA1816: Call GC.SuppressFinalize correctly
dotnet_diagnostic.CA1816.severity = warning

# CA2200: Rethrow to preserve stack details.
dotnet_diagnostic.CA2200.severity = warning

# CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2201.severity = warning

# CA2207: Initialize value type static fields inline
dotnet_diagnostic.CA2207.severity = error

# CA2208: Instantiate argument exceptions correctly
dotnet_diagnostic.CA2208.severity = warning

# CA2211: Non-constant fields should not be visible
dotnet_diagnostic.CA2211.severity = warning

# CA2213: Disposable fields should be disposed
dotnet_diagnostic.CA2213.severity = error

# CA2214: Do not call overridable methods in constructors
dotnet_diagnostic.CA2214.severity = warning

# CA2215: Dispose methods should call base class dispose
dotnet_diagnostic.CA2215.severity = error

# CA2216: Disposable types should declare finalizer
dotnet_diagnostic.CA2216.severity = error

# CA2217: Do not mark enums with FlagsAttribute
dotnet_diagnostic.CA2217.severity = warning

# CA2218: Override GetHashCode on overriding Equals
dotnet_diagnostic.CA2218.severity = warning

# CA2219: Do not raise exceptions in exception clauses
dotnet_diagnostic.CA2219.severity = error

# CA2224: Override Equals on overloading operator equals
dotnet_diagnostic.CA2224.severity = warning

# CA2225: Operator overloads have named alternates
dotnet_diagnostic.CA2225.severity = warning

# CA2226: Operators should have symmetrical overloads
dotnet_diagnostic.CA2226.severity = error

# CA2227: Collection properties should be read only
dotnet_diagnostic.CA2227.severity = suggestion

# CA2229: Implement serialization constructors
dotnet_diagnostic.CA2229.severity = error

# CA2231: Overload operator equals on overriding value type Equals
dotnet_diagnostic.CA2231.severity = error

# CA2234: Pass system uri objects instead of strings
dotnet_diagnostic.CA2234.severity = warning

# CA2235: Mark all non-serializable fields
dotnet_diagnostic.CA2235.severity = warning

# CA2237: Mark ISerializable types with serializable
dotnet_diagnostic.CA2237.severity = warning

# CA2241: Provide correct arguments to formatting methods
dotnet_diagnostic.CA2241.severity = warning

# CA2242: Test for NaN correctly
dotnet_diagnostic.CA2242.severity = error

# CA2243: Attribute string literals should parse correctly
dotnet_diagnostic.CA2243.severity = error

# CA2244: Do not duplicate indexed element initializations
dotnet_diagnostic.CA2244.severity = error

# CA2245: Do not assign a property to itself.
dotnet_diagnostic.CA2245.severity = error

# CA2246: Assigning symbol and its member in the same statement.
dotnet_diagnostic.CA2246.severity = error

# CA2247: Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum
dotnet_diagnostic.CA2247.severity = error

# CA2248: Provide correct 'enum' argument to 'Enum.HasFlag'
dotnet_diagnostic.CA2248.severity = error

# CA2249: Consider using 'string.Contains' instead of 'string.IndexOf'
dotnet_diagnostic.CA2249.severity = error

# CA2250: Use ThrowIfCancellationRequested
dotnet_diagnostic.CA2250.severity = error

# CA2251: Use String.Equals over String.Compare
dotnet_diagnostic.CA2251.severity = silent

# CA2252: Opt in to preview features before using them
dotnet_diagnostic.CA2252.severity = error

# CA2255: The ModuleInitializer attribute should not be used in libraries
dotnet_diagnostic.CA2255.severity = error

# Others ##################################################################################################################################

# CA9999: Analyzer version mismatch
dotnet_diagnostic.CA9999.severity = warning

###########################################################################################################################################
# Microsoft.VisualStudio.Threading.Analyzers                                                                                              #
# https://github.com/microsoft/vs-threading/blob/main/doc/analyzers/index.md                                                              #
###########################################################################################################################################

# Avoid legacy thread switching methods
dotnet_diagnostic.VSTHRD001.severity = error

# Avoid problematic synchronous waits
dotnet_diagnostic.VSTHRD002.severity = warning

# Avoid awaiting foreign Tasks
dotnet_diagnostic.VSTHRD003.severity = error

# Await SwitchToMainThreadAsync
dotnet_diagnostic.VSTHRD004.severity = error

# Invoke single-threaded types on Main thread
dotnet_diagnostic.VSTHRD010.severity = error

# Use AsyncLazy<T>
dotnet_diagnostic.VSTHRD011.severity = error

# Provide JoinableTaskFactory where allowed
dotnet_diagnostic.VSTHRD012.severity = error

# Avoid async void methods
dotnet_diagnostic.VSTHRD100.severity = error

# Avoid unsupported async delegates
dotnet_diagnostic.VSTHRD101.severity = error

# Implement internal logic asynchronously
dotnet_diagnostic.VSTHRD102.severity = error

# Call async methods when in an async method
dotnet_diagnostic.VSTHRD103.severity = error

# Offer async option
dotnet_diagnostic.VSTHRD104.severity = warning

# Avoid method overloads that assume TaskScheduler.Current
dotnet_diagnostic.VSTHRD105.severity = warning

# Use InvokeAsync to raise async events
dotnet_diagnostic.VSTHRD106.severity = error

# Await Task within using expression
dotnet_diagnostic.VSTHRD107.severity = error

# Assert thread affinity unconditionally
dotnet_diagnostic.VSTHRD108.severity = error

# Switch instead of assert in async methods
dotnet_diagnostic.VSTHRD109.severity = error

# Observe result of async calls
dotnet_diagnostic.VSTHRD110.severity = warning

# Use .ConfigureAwait(bool)
# - Configured by CA2007
dotnet_diagnostic.VSTHRD111.severity = none

# Implement System.IAsyncDisposable
dotnet_diagnostic.VSTHRD112.severity = error

# Check for System.IAsyncDisposable
dotnet_diagnostic.VSTHRD113.severity = error

# Avoid returning null from a Task-returning method.
dotnet_diagnostic.VSTHRD114.severity = error

# Use Async naming convention
# - Configured by Naming Conventions
dotnet_diagnostic.VSTHRD200.severity = none
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent

###########################################################################################################################################
# StyleCop                                                                                                                                #
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/DOCUMENTATION.md                                                       #
###########################################################################################################################################

# Intentionally disabled rules:
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/KnownChanges.md#disabled-rules

[*.cs]

# Special Rules ###########################################################################################################################

# All diagnostics of XML documentation comments has been disabled due to the current project configuration.
dotnet_diagnostic.SA0001.severity = none

# The **stylecop.json** settings file could not be loaded due to a deserialization error.
dotnet_diagnostic.SA0002.severity = warning

# Spacing Rules ###########################################################################################################################

# The spacing around a C# keyword is incorrect.
# - Configured by Visual Studio
dotnet_diagnostic.SA1000.severity = none

# The spacing around a comma is incorrect, within a C# code file.
# - Configured by Visual Studio
dotnet_diagnostic.SA1001.severity = none

# The spacing around a semicolon is incorrect, within a C# code file.
# - Configured by Visual Studio
dotnet_diagnostic.SA1002.severity = none

# The spacing around an operator symbol is incorrect, within a C# code file.
# - Configured by Visual Studio
dotnet_diagnostic.SA1003.severity = none

# A line within a documentation header above a C# element does not begin with a single space.
dotnet_diagnostic.SA1004.severity = warning

# A single-line comment within a C# code file does not begin with a single space.
dotnet_diagnostic.SA1005.severity = warning

# A C# preprocessor-type keyword is preceded by space.
dotnet_diagnostic.SA1006.severity = warning

# The operator keyword within a C# operator overload method is not followed by any whitespace.
# - Configured by Visual Studio
dotnet_diagnostic.SA1007.severity = none

# An opening parenthesis within a C# statement is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1008.severity = none

# A closing parenthesis within a C# statement is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1009.severity = none

# An opening square bracket within a C# statement is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1010.severity = none

# A closing square bracket within a C# statement is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1011.severity = none

# An opening brace within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1012.severity = none

# A closing brace within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1013.severity = none

# An opening generic bracket within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1014.severity = none

# A closing generic bracket within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1015.severity = none

# An opening attribute bracket within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1016.severity = none

# A closing attribute bracket within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1017.severity = none

# A nullable type symbol within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1018.severity = none

# The spacing around a member access symbol is incorrect, within a C# code file.
# - Configured by Visual Studio
dotnet_diagnostic.SA1019.severity = none

# An increment or decrement symbol within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1020.severity = none

# A negative sign within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1021.severity = none

# A positive sign within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1022.severity = none

# A dereference symbol or an access-of symbol within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1023.severity = none

# A colon within a C# element is not spaced correctly.
# - Configured by Visual Studio
dotnet_diagnostic.SA1024.severity = none

# The code contains multiple whitespace characters in a row.
dotnet_diagnostic.SA1025.severity = warning

# An implicitly typed new array allocation within a C# code file is not spaced correctly.
dotnet_diagnostic.SA1026.severity = warning

# The code contains a tab or space character which is not consistent with the current project settings.
dotnet_diagnostic.SA1027.severity = warning

# A line of code ends with a space, tab, or other whitespace characters before the end of line character(s).
# - Configured by Visual Studio
dotnet_diagnostic.SA1028.severity = none

# Readability Rules #######################################################################################################################

# A call to a member from an inherited class begins with `base.`, and the local class does not contain an override or implementation of the
# member.
dotnet_diagnostic.SA1100.severity = warning

# A call to an instance member of the local class or a base class is not prefixed with 'this.', within a C# code file.
# - Configured by Visual Studio
dotnet_diagnostic.SA1101.severity = none

# A C# query clause does not begin on the same line as the previous clause, or on the next line.
dotnet_diagnostic.SA1102.severity = warning

# The clauses within a C# query expression are not all placed on the same line, and each clause is not placed on its own line.
dotnet_diagnostic.SA1103.severity = warning

# A clause within a C# query expression begins on the same line as the previous clause, when the previous clause spans across multiple
# lines.
dotnet_diagnostic.SA1104.severity = warning

# A clause within a C# query expression spans across multiple lines, and does not begin on its own line.
dotnet_diagnostic.SA1105.severity = warning

# The C# code contains an extra semicolon.
dotnet_diagnostic.SA1106.severity = warning

# The C# code contains more than one statement on a single line.
dotnet_diagnostic.SA1107.severity = warning

# A C# statement contains a comment between the declaration of the statement and the opening brace of the statement.
dotnet_diagnostic.SA1108.severity = warning

# A C# statement contains a region tag between the declaration of the statement and the opening brace of the statement.
# Intentionally disabled by StyleCop
dotnet_diagnostic.SA1109.severity = none

# The opening parenthesis or bracket in a call to a C# method or indexer, or the declaration of a method or indexer, is not placed on the
# same line as the method or indexer name
dotnet_diagnostic.SA1110.severity = warning

# The closing parenthesis or bracket in a call to a C# method or indexer, or the declaration of a method or indexer, is not placed on the
# same line as the last parameter.
dotnet_diagnostic.SA1111.severity = warning

# The closing parenthesis or bracket in a call to a C# method or indexer, or the declaration of a method or indexer, is not placed on the
# same line as the opening bracket when the element does not take any parameters.
dotnet_diagnostic.SA1112.severity = warning

# A comma between two parameters in a call to a C# method or indexer, or in the declaration of a method or indexer, is not placed on the
# same line as the previous parameter.
dotnet_diagnostic.SA1113.severity = warning

# The start of the parameter list for a method or indexer call or declaration does not begin on the same line as the opening bracket, or on
# the line after the opening bracket.
dotnet_diagnostic.SA1114.severity = warning

# A parameter within a C# method or indexer call or declaration does not begin on the same line as the previous parameter, or on the next
# line.
dotnet_diagnostic.SA1115.severity = warning

# The parameters to a C# method or indexer call or declaration span across multiple lines, but the first parameter does not start on the
# line after the opening bracket.
dotnet_diagnostic.SA1116.severity = warning

# The parameters to a C# method or indexer call or declaration are not all on the same line or each on a separate line.
dotnet_diagnostic.SA1117.severity = warning

# A parameter to a C# method or indexer, other than the first parameter, spans across multiple lines.
dotnet_diagnostic.SA1118.severity = warning

# The C# comment does not contain any comment text.
dotnet_diagnostic.SA1120.severity = warning

# The code uses one of the basic C# types, but does not use the built-in alias for the type.
# - Configurd by Visual Studio
dotnet_diagnostic.SA1121.severity = none

# The C# code includes an empty string, written as `""`.
# - Configured by RCS1078
dotnet_diagnostic.SA1122.severity = none

# The C# code contains a region within the body of a code element.
# - Covered by SA1124
dotnet_diagnostic.SA1123.severity = none

# The C# code contains a region.
dotnet_diagnostic.SA1124.severity = warning

# The Nullable type has been defined not using the C# shorthand
dotnet_diagnostic.SA1125.severity = warning

# A call to a member is not prefixed with the 'this.', 'base.', 'object.' or 'typename.' prefix to indicate the intended method call,
# within a C# code file.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1126.severity = none

# A generic constraint on a type or method declaration is on the same line as the declaration, within a C# code file.
dotnet_diagnostic.SA1127.severity = warning

# A constructor initializer is on the same line as the constructor declaration, within a C# code file.
dotnet_diagnostic.SA1128.severity = warning

# A value type was constructed using the syntax `new T()`.
dotnet_diagnostic.SA1129.severity = warning

# An anonymous method was declared using the form `delegate (parameters) { }`, when a lambda expression would provide equivalent behavior
# with the syntax `(parameters) => { }`
dotnet_diagnostic.SA1130.severity = warning

# A comparison was made between a variable and a literal or constant value, and the variable appeared on the right-hand side of the
# expression
dotnet_diagnostic.SA1131.severity = warning

# Two or more fields were declared in the same field declaration syntax.
dotnet_diagnostic.SA1132.severity = warning

# Two or more attributes appeared within the same set of square brackets.
dotnet_diagnostic.SA1133.severity = warning

# An attribute is placed on the same line of code as another attribute or element.
dotnet_diagnostic.SA1134.severity = warning

# A using directive is not qualified
dotnet_diagnostic.SA1135.severity = warning

# Multiple enum values are placed on the same line of code.
dotnet_diagnostic.SA1136.severity = warning

# Two sibling elements which each start on their own line have different levels of indentation
dotnet_diagnostic.SA1137.severity = warning

# Use literal suffix notation instead of casting.
dotnet_diagnostic.SA1139.severity = warning

# Use tuple syntax instead of the underlying ValueTuple implementation type
dotnet_diagnostic.SA1141.severity = warning

# An element of a tuple was referenced by its metadata name when an element name is available
dotnet_diagnostic.SA1142.severity = warning

# Ordering Rules ##########################################################################################################################

# A C# using directive is placed inside of a namespace element.
# - Configured by Visual Studio
dotnet_diagnostic.SA1200.severity = none

# An element within a C# code file is out of order in relation to the other elements in the code.
# - Order is not customizable and won't be customizable in future.
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2541#issuecomment-533150009
dotnet_diagnostic.SA1201.severity = none

# An element within a C# code file is out of order within regard to access level, in relation to other elements in the code
dotnet_diagnostic.SA1202.severity = warning

# A constant field is placed beneath a non-constant field.
dotnet_diagnostic.SA1203.severity = warning

# A static element is positioned beneath an instance element of the same type.
dotnet_diagnostic.SA1204.severity = none

# The partial element does not have an access modifier defined.
dotnet_diagnostic.SA1205.severity = warning

# The keywords within the declaration of an element do not follow a standard ordering scheme.
# - Configured by Visual Studio
dotnet_diagnostic.SA1206.severity = none

# The keyword *protected* is positioned after the keyword *internal* within the declaration of a protected internal C# element.
# - Configured by Visual Studio
dotnet_diagnostic.SA1207.severity = none

# A using directive which declares a member of the *System* namespace appears after a using directive which declares a member of a
# different namespace, within a C# code file.
# - Configured by Visual Studio
dotnet_diagnostic.SA1208.severity = none

# A using-alias directive is positioned before a regular using directive.
dotnet_diagnostic.SA1209.severity = warning

# The using directives within a C# code file are not sorted alphabetically by namespace.
dotnet_diagnostic.SA1210.severity = warning

# The using-alias directives within a C# code file are not sorted alphabetically by alias name.
dotnet_diagnostic.SA1211.severity = warning

# A get accessor appears after a set accessor within a property or indexer.
dotnet_diagnostic.SA1212.severity = warning

# An add accessor appears after a remove accessor within an event.
dotnet_diagnostic.SA1213.severity = warning

# A readonly field is positioned beneath a non-readonly field.
dotnet_diagnostic.SA1214.severity = none

# An instance readonly element is positioned beneath an instance non-readonly element of the same type.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1215.severity = none

# A `using static` directive is positioned at the wrong location (before a regular using directive or after an alias using directive).
dotnet_diagnostic.SA1216.severity = warning

# The `using static` directives within a C# code file are not sorted alphabetically by full type name.
dotnet_diagnostic.SA1217.severity = warning

# Naming Rules ############################################################################################################################

# The name of a C# element does not begin with an upper-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1300.severity = none

# There are currently no situations in which this rule will fire.
dotnet_diagnostic.SA1301.severity = none

# The name of a C# interface does not begin with the capital letter I.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1302.severity = none

# The name of a constant C# field should begin with an upper-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1303.severity = none

# The name of a non-private readonly C# field should being with an upper-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1304.severity = none

# The name of a field or variable in C# uses Hungarian notation.
# - This rule just disallows names with a 2 or less characters segment at the beginning (z.B. "saUsa" => Violation)
dotnet_diagnostic.SA1305.severity = none

# The name of a field in C# does not begin with a lower-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1306.severity = none

# The name of a public or internal field in C# does not begin with an upper-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1307.severity = none

# A field name in C# is prefixed with *m_* or *s_*.
# - Configured by Visual Studio
dotnet_diagnostic.SA1308.severity = none

# A field name in C# begins with an underscore.
# - Configured by Visual Studio
dotnet_diagnostic.SA1309.severity = none

# A field name in C# contains an underscore.
dotnet_diagnostic.SA1310.severity = warning

# The name of a static readonly field does not begin with an upper-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1311.severity = none

# The name of a variable in C# does not begin with a lower-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1312.severity = none

# The name of a parameter in C# does not begin with a lower-case letter.
# - Configured by Naming Conventions
dotnet_diagnostic.SA1313.severity = none

# The name of a C# type parameter does not begin with the capital letter T
# - Configured by Naming Conventions
dotnet_diagnostic.SA1314.severity = none

# Element names within a tuple type should have the correct casing
dotnet_diagnostic.SA1316.severity = warning

# Maintainability #########################################################################################################################

# A C# statement contains parenthesis which are unnecessary and should be removed.
# - Configured by Visual Studio
dotnet_diagnostic.SA1119.severity = none

# The access modifier for a C# element has not been explicitly defined.
# - Configured by Visual Studio
dotnet_diagnostic.SA1400.severity = none

# A field within a C# class has an access modifier other than private.
# - Configured by CA1051
dotnet_diagnostic.SA1401.severity = none

# A C# code file contains more than one unique type.
dotnet_diagnostic.SA1402.severity = warning

# A C# code file contains more than one namespace.
dotnet_diagnostic.SA1403.severity = warning

# A Code Analysis SuppressMessage attribute does not include a justification.
dotnet_diagnostic.SA1404.severity = warning

# A call to Debug.Assert in C# code does not include a descriptive message.
dotnet_diagnostic.SA1405.severity = warning

# A call to Debug.Fail in C# code does not include a descriptive message.
dotnet_diagnostic.SA1406.severity = warning

# A C# statement contains a complex arithmetic expression which omits parenthesis around operators.
# - Configured by Visual Studio
dotnet_diagnostic.SA1407.severity = none

# A C# statement contains a complex conditional expression which omits parenthesis around operators.
# - Configured by Visual Studio
dotnet_diagnostic.SA1408.severity = none

# A C# file contains code which is unnecessary and can be removed without changing the overall logic of the code.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1409.severity = none

# A call to a C# anonymous method does not contain any method parameters, yet the statement still includes parenthesis.
dotnet_diagnostic.SA1410.severity = warning

# An attribute declaration does not contain any parameters, yet it still includes parenthesis.
dotnet_diagnostic.SA1411.severity = warning

# The encoding of the file is not UTF-8 with byte order mark.
dotnet_diagnostic.SA1412.severity = none

# A multi-line initializer should use a comma on the last item.
dotnet_diagnostic.SA1413.severity = warning

# Tuple types appearing in member declarations should have explicitly named tuple elements
dotnet_diagnostic.SA1414.severity = warning

# Layout Rules ############################################################################################################################

# The opening or closing brace within a C# statement, element, or expression is not placed on its own line.
# - Configured by Visual Studio, but not in Error List
dotnet_diagnostic.SA1500.severity = warning

# A C# statement containing opening and closing braces is written completely on a single line.
# - Configured by Visual Studio, but not in Error List
dotnet_diagnostic.SA1501.severity = warning

# A C# element containing opening and closing braces is written completely on a single line.
# - Configured by Visual Studio, but not in Error List
dotnet_diagnostic.SA1502.severity = warning

# The opening and closing braces for a C# statement have been omitted.
# - Configured by Visual Studio
dotnet_diagnostic.SA1503.severity = none

# Within a C# property, indexer or event, at least one of the child accessors is written on a single line, and at least one of the child
# accessors is written across multiple lines.
dotnet_diagnostic.SA1504.severity = warning

# An opening brace within a C# element, statement, or expression is followed by a blank line.
dotnet_diagnostic.SA1505.severity = warning

# An element documentation header above a C# element is followed by a blank line.
dotnet_diagnostic.SA1506.severity = warning

# The C# code contains multiple blank lines in a row.
dotnet_diagnostic.SA1507.severity = warning

# A closing brace within a C# element, statement, or expression is preceded by a blank line.
dotnet_diagnostic.SA1508.severity = warning

# An opening brace within a C# element, statement, or expression is preceded by a blank line.
dotnet_diagnostic.SA1509.severity = warning

# Chained C# statements are separated by a blank line.
dotnet_diagnostic.SA1510.severity = warning

# The while footer at the bottom of a do-while statement is separated from the statement by a blank line.
dotnet_diagnostic.SA1511.severity = warning

# A single-line comment within C# code is followed by a blank line.
dotnet_diagnostic.SA1512.severity = warning

# A closing brace within a C# element, statement, or expression is not followed by a blank line.
dotnet_diagnostic.SA1513.severity = warning

# An element documentation header above a C# element is not preceded by a blank line.
dotnet_diagnostic.SA1514.severity = warning

# A single-line comment within C# code is not preceded by a blank line.
dotnet_diagnostic.SA1515.severity = warning

# Adjacent C# elements are not separated by a blank line.
dotnet_diagnostic.SA1516.severity = warning

# The code file has blank lines at the start.
dotnet_diagnostic.SA1517.severity = warning

# The line endings at the end of a file do not match the settings for the project.
dotnet_diagnostic.SA1518.severity = warning

# The opening and closing braces for a multi-line C# statement have been omitted.
# - Configured by Visual Studio
dotnet_diagnostic.SA1519.severity = none

# The opening and closing braces of a chained `if`/`else if`/`else` construct were included for some clauses, but omitted for others
# - Configured by Visual Studio
dotnet_diagnostic.SA1520.severity = none

# Documentation Rules #####################################################################################################################

# A C# code element is missing a documentation header.
dotnet_diagnostic.SA1600.severity = none

# A C# partial element is missing a documentation header.
dotnet_diagnostic.SA1601.severity = none

# An item within a C# enumeration is missing an Xml documentation header.
dotnet_diagnostic.SA1602.severity = none

# The Xml within a C# element's document header is badly formed.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1603.severity = none

# The Xml header documentation for a C# element is missing a `<summary>` tag.
dotnet_diagnostic.SA1604.severity = warning

# The `<summary>` or `<content>` tag within the documentation header for a C# code element is missing or empty.
dotnet_diagnostic.SA1605.severity = warning

# The `<summary>` tag within the documentation header for a C# code element is empty.
dotnet_diagnostic.SA1606.severity = warning

# The `<summary>` or `<content>` tag within the documentation header for a C# code element is empty.
dotnet_diagnostic.SA1607.severity = warning

# The `<summary>` tag within an element's Xml header documentation contains the default text generated by Visual Studio during the creation
# of the element.
dotnet_diagnostic.SA1608.severity = warning

# The Xml header documentation for a C# property does not contain a `<value>` tag.
dotnet_diagnostic.SA1609.severity = none

# The Xml header documentation for a C# property contains an empty `<value>` tag.
dotnet_diagnostic.SA1610.severity = warning

# A C# method, constructor, delegate or indexer element is missing documentation for one or more of its parameters.
dotnet_diagnostic.SA1611.severity = warning

# The documentation describing the parameters to a C# method, constructor, delegate or indexer element does not match the actual parameters
# on the element.
dotnet_diagnostic.SA1612.severity = warning

# A `<param>` tag within a C# element's documentation header is missing a name attribute containing the name of the parameter.
dotnet_diagnostic.SA1613.severity = warning

# A `<param>` tag within a C# element's documentation header is empty.
dotnet_diagnostic.SA1614.severity = warning

# A C# element is missing documentation for its return value.
dotnet_diagnostic.SA1615.severity = warning

# The `<returns>` tag within a C# element's documentation header is empty.
dotnet_diagnostic.SA1616.severity = warning

# A C# code element does not contain a return value, or returns void, but the documentation header for the element contains a `<returns>`
# tag.
dotnet_diagnostic.SA1617.severity = warning

# A generic C# element is missing documentation for one or more of its generic type parameters.
dotnet_diagnostic.SA1618.severity = warning

# A generic, partial C# element is missing documentation for one or more of its generic type parameters, and the documentation for the
# element contains a `<summary>` tag.
dotnet_diagnostic.SA1619.severity = warning

# The `<typeparam>` tags within the Xml header documentation for a generic C# element do not match the generic type parameters on the element.
dotnet_diagnostic.SA1620.severity = warning

# A `<typeparam>` tag within the Xml header documentation for a generic C# element is missing a name attribute, or contains an empty name
# attribute.
dotnet_diagnostic.SA1621.severity = warning

# A `<typeparam>` tag within the Xml header documentation for a generic C# element is empty.
dotnet_diagnostic.SA1622.severity = warning

# The documentation text within a C# property's `<summary>` tag does not match the accessors within the property.
# - Rule forces english language.
dotnet_diagnostic.SA1623.severity = none

# The documentation text within a C# property's `<summary>` tag takes into account all of the accessors within the property, but one of the
# accessors has limited access.
# - Rule forces english language.
dotnet_diagnostic.SA1624.severity = none

# The Xml documentation for a C# element contains two or more identical entries, indicating that the documentation has been copied and
# pasted
dotnet_diagnostic.SA1625.severity = warning

# The C# code contains a single-line comment which begins with three forward slashes in a row.
dotnet_diagnostic.SA1626.severity = warning

# The Xml header documentation for a C# code element contains an empty tag.
dotnet_diagnostic.SA1627.severity = warning

# A section of the Xml header documentation for a C# element does not begin with a capital letter.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1628.severity = none

# A section of the Xml header documentation for a C# element does not end with a period (also known as a full stop).
dotnet_diagnostic.SA1629.severity = warning

# A section of the Xml header documentation for a C# element does not contain any whitespace between words.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1630.severity = none

# A section of the Xml header documentation for a C# element does not contain enough alphabetic characters.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1631.severity = none

# From StyleCop 4.5 this rule is disabled by default.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1632.severity = none

# A C# code file is missing a standard file header.
dotnet_diagnostic.SA1633.severity = none

# The file header at the top of a C# code file is missing a copyright tag.
dotnet_diagnostic.SA1634.severity = warning

# The file header at the top of a C# code file is missing copyright text.
dotnet_diagnostic.SA1635.severity = warning

# The file header at the top of a C# code file does not contain the appropriate copyright text.
dotnet_diagnostic.SA1636.severity = warning

# The file header at the top of a C# code file is missing the file name.
dotnet_diagnostic.SA1637.severity = warning

# The file tag within the file header at the top of a C# code file does not contain the name of the file.
dotnet_diagnostic.SA1638.severity = warning

# The file header at the top of a C# code file does not contain a filled-in summary tag.
dotnet_diagnostic.SA1639.severity = warning

# The file header at the top of a C# code file does not contain company name text.
dotnet_diagnostic.SA1640.severity = warning

# The file header at the top of a C# code file does not contain the appropriate company name text.
dotnet_diagnostic.SA1641.severity = warning

# The XML documentation header for a C# constructor does not contain the appropriate summary text.
dotnet_diagnostic.SA1642.severity = warning

# The Xml documentation header for a C# finalizer does not contain the appropriate summary text.
dotnet_diagnostic.SA1643.severity = warning

# A section within the Xml documentation header for a C# element contains blank lines.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1644.severity = none

# An included Xml documentation file does not exist.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1645.severity = none

# An included Xml documentation link contains an invalid path.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1646.severity = none

# An include tag within an Xml documentation header does not contain valid file and path attribute.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1647.severity = none

# `<inheritdoc>` has been used on an element that doesn't inherit from a base class or implement an interface.
dotnet_diagnostic.SA1648.severity = warning

# The file name of a C# code file does not match the first type declared in the file.
dotnet_diagnostic.SA1649.severity = warning

# The element documentation for the element contains one or more spelling mistakes or unrecognized words.
# - Intentionally disabled by StyleCop
dotnet_diagnostic.SA1650.severity = none

# The documentation for the element contains one or more `<placeholder>` elements.
dotnet_diagnostic.SA1651.severity = warning

# Alternative Rules #######################################################################################################################

# A call to an instance member of the local class or a base class is prefixed with 'this.', within a C# code file.
# - Conflicts with SA1101
dotnet_diagnostic.SX1101.severity = none

# A field name does not begin with an underscore.
# - Configured by Coding Conventions
dotnet_diagnostic.SX1309.severity = none

# A static field name does not begin with an underscore.
# - Configured by Coding Conventions
dotnet_diagnostic.SX1309S.severity = none

###########################################################################################################################################
# Roslynator                                                                                                                              #
# https://github.com/JosefPihrt/Roslynator                                                                                                #
###########################################################################################################################################

###########################################################################################################################################
# Roslynator Analyzers                                                                                                                    #
# https://github.com/JosefPihrt/Roslynator/blob/master/src/Analyzers/README.md                                                            #
###########################################################################################################################################

[*.cs]

# Add braces (when expression spans over multiple lines)
# - Conflicts with RCS1007
dotnet_diagnostic.RCS1001.severity = none

# Remove braces
# - Conflicts with RCS1007
dotnet_diagnostic.RCS1002.severity = none

# Add braces to if-else (when expression spans over multiple lines)
# - Conflicts with RCS1007
dotnet_diagnostic.RCS1003.severity = none

# Remove braces from if-else
# - Conflicts with RCS1007
dotnet_diagnostic.RCS1004.severity = none

# Simplify nested using statement
dotnet_diagnostic.RCS1005.severity = warning

# Merge else clause with nested if statement
dotnet_diagnostic.RCS1006.severity = warning

# Add braces
# - Configured by Visual Studio
dotnet_diagnostic.RCS1007.severity = none

# Use explicit type instead of 'var' (when the type is not obvious)
# - Configured in Visual Studio
dotnet_diagnostic.RCS1008.severity = none

# Use explicit type instead of 'var' (foreach variable)
# - Configured in Visual Studio
dotnet_diagnostic.RCS1009.severity = none

# Use 'var' instead of explicit type (when the type is obvious)
# - Configured in Visual Studio
dotnet_diagnostic.RCS1010.severity = none

# Use explicit type instead of 'var' (when the type is obvious)
# - Configured in Visual Studio
dotnet_diagnostic.RCS1012.severity = none

# Use predefined type
# - Configured in Visual Studio
dotnet_diagnostic.RCS1013.severity = none

# Use explicitly/implicitly typed array
dotnet_diagnostic.RCS1014.severity = warning
roslynator_array_creation_type_style = implicit_when_type_is_obvious
# - VS2019 Compatibility
roslynator.RCS1014.use_implicit_type_when_obvious = true

# Use nameof operator
# - Configured by CA1507
dotnet_diagnostic.RCS1015.severity = none

# Use expression-bodied member
# - Configured by Visual Studio
dotnet_diagnostic.RCS1016.severity = none

# Add accessibility modifiers
# - Configured by Visual Studio
dotnet_diagnostic.RCS1018.severity = none
roslynator_accessibility_modifiers = explicit

# Order modifiers
# - Configured by Visual Studio
dotnet_diagnostic.RCS1019.severity = none

# Simplify Nullable<T> to T?
# - Configured by SA1125
dotnet_diagnostic.RCS1020.severity = none

# Simplify lambda expression
# - Configured by Visual Studio
dotnet_diagnostic.RCS1021.severity = none

# Remove unnecessary braces
# - Configured by Visual Studio
dotnet_diagnostic.RCS1031.severity = none

# Remove redundant parentheses
# - Configured by Visual Studio
dotnet_diagnostic.RCS1032.severity = none

# Remove redundant boolean literal
dotnet_diagnostic.RCS1033.severity = warning

# Remove redundant 'sealed' modifier
dotnet_diagnostic.RCS1034.severity = warning

# Remove redundant comma in initializer
# - Configured by SA1413
dotnet_diagnostic.RCS1035.severity = none

# Remove redundant empty line
# - Configured by SA1507
dotnet_diagnostic.RCS1036.severity = none

# Remove trailing white-space
# - Configured by SA1028
dotnet_diagnostic.RCS1037.severity = none

# Remove empty statement
# - Configured by SA 1106
dotnet_diagnostic.RCS1038.severity = none

# Remove argument list from attribute
# - Configured by SA1411
dotnet_diagnostic.RCS1039.severity = none

# Remove empty else clause
# - Configured by RCS1211
dotnet_diagnostic.RCS1040.severity = none

# Remove empty initializer
dotnet_diagnostic.RCS1041.severity = warning

# Remove enum default underlying type
dotnet_diagnostic.RCS1042.severity = warning

# Remove 'partial' modifier from type with a single part
dotnet_diagnostic.RCS1043.severity = warning

# Remove original exception from throw statement
# - Configured by C#
dotnet_diagnostic.RCS1044.severity = none

# Rename private field according to camel case with underscore
# - Conflicts with Coding Conventions
dotnet_diagnostic.RCS1045.severity = none

# Asynchronous method name should end with 'Async'
# - Configured by Coding Conventions
dotnet_diagnostic.RCS1046.severity = none

# Non-asynchronous method name should not end with 'Async'
dotnet_diagnostic.RCS1047.severity = warning

# Use lambda expression instead of anonymous method
dotnet_diagnostic.RCS1048.severity = error

# Simplify boolean comparison
dotnet_diagnostic.RCS1049.severity = warning

# Add argument list to object creation expression
dotnet_diagnostic.RCS1050.severity = warning
roslynator_object_creation_parentheses_style = include

# Parenthesize condition in conditional expression
# - Configured by Visual studio
dotnet_diagnostic.RCS1051.severity = none

# Declare each attribute separately
# - Configured by SA1133
dotnet_diagnostic.RCS1052.severity = none

# Avoid semicolon at the end of declaration
dotnet_diagnostic.RCS1055.severity = warning

# Avoid usage of using alias directive
dotnet_diagnostic.RCS1056.severity = warning

# Use compound assignment
# - Configured by Visual Studio
dotnet_diagnostic.RCS1058.severity = none

# Avoid locking on publicly accessible instance
dotnet_diagnostic.RCS1059.severity = error

# Declare each type in separate file
# - Configured by SA1402
dotnet_diagnostic.RCS1060.severity = none

# Merge if statement with nested if statement
dotnet_diagnostic.RCS1061.severity = warning

# Avoid usage of do statement to create an infinite loop
dotnet_diagnostic.RCS1063.severity = warning

# Avoid usage of for statement to create an infinite loop
dotnet_diagnostic.RCS1064.severity = warning

# Avoid usage of while statement to create an inifinite loop
# - Conflicts with RCS1063, RCS1064
dotnet_diagnostic.RCS1065.severity = none

# Remove empty finally clause
dotnet_diagnostic.RCS1066.severity = warning

# Simplify logical negation
dotnet_diagnostic.RCS1068.severity = warning

# Remove unnecessary case label
dotnet_diagnostic.RCS1069.severity = warning

# Remove redundant default switch section
dotnet_diagnostic.RCS1070.severity = warning

# Remove redundant base constructor call
dotnet_diagnostic.RCS1071.severity = warning

# Remove empty namespace declaration
dotnet_diagnostic.RCS1072.severity = warning

# Convert 'if' to 'return' statement
# - Configured by Visual Studio
dotnet_diagnostic.RCS1073.severity = none

# Remove redundant constructor
dotnet_diagnostic.RCS1074.severity = warning

# Avoid empty catch clause that catches System.Exception
dotnet_diagnostic.RCS1075.severity = error

# Optimize LINQ method call
dotnet_diagnostic.RCS1077.severity = warning

# Use "" instead of string.Empty
dotnet_diagnostic.RCS1078.severity = warning
roslynator_empty_string_style = field
# - VS2019 Compatibility
roslynator.RCS1078.invert = true

# Throwing of new NotImplementedException
dotnet_diagnostic.RCS1079.severity = none

# Use 'Count/Length' property instead of 'Any' method
# - Configured by CA1829
dotnet_diagnostic.RCS1080.severity = none

# Split variable declaration
# - Configured by SA1132
dotnet_diagnostic.RCS1081.severity = none

# Use coalesce expression instead of conditional expression
# - Configured by Visual Studio
dotnet_diagnostic.RCS1084.severity = none

# Use auto-implemented property
# - Configured by Visual Studio
dotnet_diagnostic.RCS1085.severity = none

# Use --/++ operator instead of assignment
dotnet_diagnostic.RCS1089.severity = warning

# Call 'ConfigureAwait(false)'
# - Configured by CA2007
dotnet_diagnostic.RCS1090.severity = none

# Remove empty region
# - Configured by SA1124
dotnet_diagnostic.RCS1091.severity = none

# Remove file with no code
dotnet_diagnostic.RCS1093.severity = warning

# Declare using directive on top level
# - Configured by SA1200
dotnet_diagnostic.RCS1094.severity = none

# Use 'HasFlag' method or bitwise operator
dotnet_diagnostic.RCS1096.severity = none

# Remove redundant 'ToString' call
dotnet_diagnostic.RCS1097.severity = warning

# Avoid 'null' on the left side of a binary expression
dotnet_diagnostic.RCS1098.severity = warning

# Default label should be the last label in a switch section
dotnet_diagnostic.RCS1099.severity = warning

# Format documentation summary on a single line
dotnet_diagnostic.RCS1100.severity = none

# Format documentation summary on multiple lines
dotnet_diagnostic.RCS1101.severity = warning

# Make class static
# - Configured by C#
dotnet_diagnostic.RCS1102.severity = none

# Convert 'if' to assignment
dotnet_diagnostic.RCS1103.severity = warning

# Simplify conditional expression
dotnet_diagnostic.RCS1104.severity = warning
roslynator.RCS1104.suppress_when_condition_is_inverted = false

# Unncessary interpolation
dotnet_diagnostic.RCS1105.severity = warning

# Remove empty destructor
# - Configured by C#
dotnet_diagnostic.RCS1106.severity = none

# Remove redundant 'ToCharArray' call
dotnet_diagnostic.RCS1107.severity = warning

# Add 'static' modifier to all partial class declarations
dotnet_diagnostic.RCS1108.severity = warning

# Declare type inside namespace
# - Configured by CA1050
dotnet_diagnostic.RCS1110.severity = none

# Add braces to switch section with multiple statements
dotnet_diagnostic.RCS1111.severity = none

# Combine 'Enumerable.Where' method chain
dotnet_diagnostic.RCS1112.severity = warning

# Use 'string.IsNullOrEmpty' method
dotnet_diagnostic.RCS1113.severity = error

# Remove redundant delegate creation
dotnet_diagnostic.RCS1114.severity = warning

# Mark local variable as const
dotnet_diagnostic.RCS1118.severity = warning

# Add parentheses according to operator precedence
# - Configured by Visual Studio
dotnet_diagnostic.RCS1123.severity = none

# Inline local variable
dotnet_diagnostic.RCS1124.severity = suggestion

# Add braces to if-else
# - Configured by Visual Studio
dotnet_diagnostic.RCS1126.severity = none

# Use coalesce expression
# - Configured by Visual Studio
dotnet_diagnostic.RCS1128.severity = none

# Remove redundant field initalization
dotnet_diagnostic.RCS1129.severity = warning

# Bitwise operation on enum without Flags attribute
dotnet_diagnostic.RCS1130.severity = none

# Remove redundant overriding member
dotnet_diagnostic.RCS1132.severity = warning

# Remove redundant Dispose/Close call
dotnet_diagnostic.RCS1133.severity = warning

# Remove redundant statement
dotnet_diagnostic.RCS1134.severity = warning

# Declare enum member with zero value (when enum has FlagsAttribute)
dotnet_diagnostic.RCS1135.severity = warning

# Merge switch sections with equivalent content
dotnet_diagnostic.RCS1136.severity = warning

# Add summary to documentation comment
# - Configured by SA1604
dotnet_diagnostic.RCS1138.severity = none

# Add summary element to documentation comment
# - Configured by SA1604
dotnet_diagnostic.RCS1139.severity = none

# Add exception to documentation comment
dotnet_diagnostic.RCS1140.severity = warning

# Add 'param' element to documentation comment
# Configured by SA1611
dotnet_diagnostic.RCS1141.severity = none

# Add 'typeparam' element to documentation comment
# - Configured by SA1622
dotnet_diagnostic.RCS1142.severity = none

# Simplify coalesce expression
dotnet_diagnostic.RCS1143.severity = warning

# Remove redundant 'as' operator
dotnet_diagnostic.RCS1145.severity = warning

# Use conditional access
dotnet_diagnostic.RCS1146.severity = warning

# Remove redundant cast
dotnet_diagnostic.RCS1151.severity = warning

# Sort enum members
dotnet_diagnostic.RCS1154.severity = warning

# Use StringComparison when comparing strings
dotnet_diagnostic.RCS1155.severity = warning

# Use string.Length instead of comparison with empty string
# - Configured by CA1820
dotnet_diagnostic.RCS1156.severity = none

# Composite enum value contains undefined flag
dotnet_diagnostic.RCS1157.severity = error

# Static member in generic type should use a type parameter
# - Conflicts with CA1000
dotnet_diagnostic.RCS1158.severity = none

# Use EventHandler<T>
# - Configured by CA1003
dotnet_diagnostic.RCS1159.severity = none

# Abstract type should not have public constructors
# - Configured by CA1012
dotnet_diagnostic.RCS1160.severity = none

# Enum should declare explicit values
dotnet_diagnostic.RCS1161.severity = warning

# Avoid chain of assignments
dotnet_diagnostic.RCS1162.severity = warning

# Unused parameter
# - Configured by Visual Studio
dotnet_diagnostic.RCS1163.severity = none

# Unused type parameter
dotnet_diagnostic.RCS1164.severity = warning

# Unconstrained type parameter checked for null
dotnet_diagnostic.RCS1165.severity = error

# Value type object is never equal to null
dotnet_diagnostic.RCS1166.severity = error

# Parameter name differs from base name
dotnet_diagnostic.RCS1168.severity = warning

# Make field read-only
# - Configured by Visual Studio
dotnet_diagnostic.RCS1169.severity = none

# Use read-only auto-implemented property
dotnet_diagnostic.RCS1170.severity = warning

# Simplify lazy initialization
dotnet_diagnostic.RCS1171.severity = warning

# Use 'is' operator instead of 'as' operator
dotnet_diagnostic.RCS1172.severity = warning

# Use coalesce expression instead of if
# - Configured by Visual Studio
dotnet_diagnostic.RCS1173.severity = none

# Remove redundant async/await
dotnet_diagnostic.RCS1174.severity = warning

# Unused this parameter
dotnet_diagnostic.RCS1175.severity = warning

# Use 'var' instead of explicit type (when the type is not obvious)
# - Configured by Visual Studio
dotnet_diagnostic.RCS1176.severity = none

# Use 'var' instead of explicit type (in foreach)
# - Configured by Visual Studio
dotnet_diagnostic.RCS1177.severity = none

# Use return instead of assignment
dotnet_diagnostic.RCS1179.severity = warning

# Inline lazy initialization
dotnet_diagnostic.RCS1180.severity = none

# Convert comment to documentation comment
dotnet_diagnostic.RCS1181.severity = warning

# Remove redundant base interface
dotnet_diagnostic.RCS1182.severity = warning

# Use Regex instance instead of static method
# - https://stackoverflow.com/questions/414328/using-static-regex-ismatch-vs-creating-an-instance-of-regex
dotnet_diagnostic.RCS1186.severity = none

# Use constant instead of field
# - Configured by CA1802
dotnet_diagnostic.RCS1187.severity = none

# Remove redundant auto-property initialization
dotnet_diagnostic.RCS1188.severity = warning

# Add or remove region name
# - Configured by SA1124
dotnet_diagnostic.RCS1189.severity = none

# Join string expressions
dotnet_diagnostic.RCS1190.severity = warning

# Declare enum value as combination of names
dotnet_diagnostic.RCS1191.severity = warning

# Use regular string literal instead of verbatim string literal
dotnet_diagnostic.RCS1192.severity = warning

# Overriding member cannot change 'params' modifier
dotnet_diagnostic.RCS1193.severity = error

# Implement exception constructors
# - Configured by CA1032
dotnet_diagnostic.RCS1194.severity = none

# Use ^ operator
dotnet_diagnostic.RCS1195.severity = warning

# Call extension method as instance method
dotnet_diagnostic.RCS1196.severity = warning

# Optimize StringBuilder.Append/AppendLine call
dotnet_diagnostic.RCS1197.severity = warning

# Avoid unnecessary boxing of value type
# - https://davidzych.com/when-doing-string-concatenation-in-c-why-dont-you-have-to-call-tostring-on-non-string-variables/
# - Performance difference is negligible
dotnet_diagnostic.RCS1198.severity = silent

# Simplify boolean expression
dotnet_diagnostic.RCS1199.severity = warning

# Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'
dotnet_diagnostic.RCS1200.severity = error

# Use method chaining
dotnet_diagnostic.RCS1201.severity = warning

# Avoid NullReferenceException
dotnet_diagnostic.RCS1202.severity = error

# Use AttributeUsageAttribute
# - Configured by CA1018
dotnet_diagnostic.RCS1203.severity = none

# Use EventArgs.Empty
dotnet_diagnostic.RCS1204.severity = error

# Order named arguments according to the order of parameters
dotnet_diagnostic.RCS1205.severity = warning

# Use conditional access instead of conditional expression
dotnet_diagnostic.RCS1206.severity = warning

# Use anonymous function or method group
dotnet_diagnostic.RCS1207.severity = warning
roslynator_use_anonymous_function_or_method_group = method_group

# Reduce if nesting
# - Conflicts with if statements in multiline lambda expressions
dotnet_diagnostic.RCS1208.severity = none

# Order type parameter constraints
dotnet_diagnostic.RCS1209.severity = warning

# Return Task.FromResult instead of returning null
dotnet_diagnostic.RCS1210.severity = error

# Remove unnecessary else clause
dotnet_diagnostic.RCS1211.severity = warning

# Remove redundant assignment
dotnet_diagnostic.RCS1212.severity = warning

# Remove unused member declaration
dotnet_diagnostic.RCS1213.severity = warning

# Unnecessary interpolated string
dotnet_diagnostic.RCS1214.severity = warning

# Expression is always equal to true/false
dotnet_diagnostic.RCS1215.severity = warning

# Unnecessary unsafe context
dotnet_diagnostic.RCS1216.severity = warning

# Convert interpolated string to concatenation
dotnet_diagnostic.RCS1217.severity = warning

# Simplify code branching
dotnet_diagnostic.RCS1218.severity = warning

# Use pattern matching instead of combination of 'is' operator and cast operator
dotnet_diagnostic.RCS1220.severity = error

# Use pattern matching instead of combination of 'as' operator and null check
dotnet_diagnostic.RCS1221.severity = warning

# Merge preprocessor directives
dotnet_diagnostic.RCS1222.severity = warning

# Mark publicly visible type with DebuggerDisplay attribute
dotnet_diagnostic.RCS1223.severity = none

# Make method an extension method
dotnet_diagnostic.RCS1224.severity = error

# Make class sealed
dotnet_diagnostic.RCS1225.severity = warning

# Add paragraph to documentation comment
dotnet_diagnostic.RCS1226.severity = warning

# Validate arguments correctly
# - Configured by CA1062
dotnet_diagnostic.RCS1227.severity = none

# Unused element in documentation comment
dotnet_diagnostic.RCS1228.severity = warning

# Use async/await when necessary
dotnet_diagnostic.RCS1229.severity = error

# Unnecessary usage of enumerator
dotnet_diagnostic.RCS1230.severity = warning

# Make parameter ref read-only
dotnet_diagnostic.RCS1231.severity = none

# Order elements in documentation comment
dotnet_diagnostic.RCS1232.severity = warning

# Use short-circuiting operator
dotnet_diagnostic.RCS1233.severity = warning

# Duplicate enum value
dotnet_diagnostic.RCS1234.severity = warning

# Optimize method call
dotnet_diagnostic.RCS1235.severity = warning

# Use exception filter
dotnet_diagnostic.RCS1236.severity = error

# Use bit shift operator
dotnet_diagnostic.RCS1237.severity = none

# Avoid nested ?: operators
dotnet_diagnostic.RCS1238.severity = warning

# Use 'for' statement instead of 'while' statement
dotnet_diagnostic.RCS1239.severity = warning

# Operator is unnecessary
dotnet_diagnostic.RCS1240.severity = warning

# Implement non-generic counterpart
dotnet_diagnostic.RCS1241.severity = warning

# Do not pass non-read-only struct by read-only reference
dotnet_diagnostic.RCS1242.severity = error

# Duplicate word in a comment
dotnet_diagnostic.RCS1243.severity = warning

# Simplify 'default' expression
dotnet_diagnostic.RCS1244.severity = warning

# Use element access
dotnet_diagnostic.RCS1246.severity = warning
roslynator.RCS1246.suppress_when_expression_is_invocation = true

# Fix documentation comment tag
dotnet_diagnostic.RCS1247.severity = warning

# Use 'is null' pattern instead of comparison (or vice versa)
dotnet_diagnostic.RCS1248.severity = warning
roslynator_null_check_style = pattern_matching

# Unnecessary null-forgiving operator
dotnet_diagnostic.RCS1249.severity = warning

# Use implicit/explicit object creation
dotnet_diagnostic.RCS1250.severity = warning
roslynator_object_creation_type_style = implicit_when_type_is_obvious
roslynator_use_var_instead_of_implicit_object_creation = false

###########################################################################################################################################
# Roslynator Code Analysis                                                                                                                #
# https://github.com/JosefPihrt/Roslynator/blob/master/src/CodeAnalysis.Analyzers/README.md                                               #
###########################################################################################################################################

# Use pattern matching
dotnet_diagnostic.RCS9001.severity = error

# Use property SyntaxNode.SpanStart
dotnet_diagnostic.RCS9002.severity = error

# Unnecessary conditional access
dotnet_diagnostic.RCS9003.severity = error

# Call 'Any' instead of accessing 'Count'
dotnet_diagnostic.RCS9004.severity = error

# Unnecessary null check
dotnet_diagnostic.RCS9005.severity = error

# Use element access
dotnet_diagnostic.RCS9006.severity = error

# Use return value
dotnet_diagnostic.RCS9007.severity = none

# Call 'Last' instead of using []
dotnet_diagnostic.RCS9008.severity = error

# Unknown language name
dotnet_diagnostic.RCS9009.severity = error

# Specify ExportCodeRefactoringProviderAttribute.Name
dotnet_diagnostic.RCS9010.severity = error

# Specify ExportCodeFixProviderAttribute.Name
dotnet_diagnostic.RCS9011.severity = error

###########################################################################################################################################
# Roslynator Formatting                                                                                                                   #
# https://github.com/JosefPihrt/Roslynator/blob/master/src/Formatting.Analyzers/README.md                                                 #
###########################################################################################################################################

# Add empty line after embedded statement
# - Conflicts with Visual Studio preferences (always use braces)
dotnet_diagnostic.RCS0001.severity = none

# Add empty line after #region
dotnet_diagnostic.RCS0002.severity = none

# Add empty line after using directive list
# - Configured by SA1513
dotnet_diagnostic.RCS0003.severity = none

# Add empty line before 'while' keyword in 'do' statement
# - Configured by SA1508
dotnet_diagnostic.RCS0004.severity = none

# Add empty line after #region
dotnet_diagnostic.RCS0005.severity = none

# Add empty line before using directive list
dotnet_diagnostic.RCS0006.severity = none

# Add empty line between accessors
# - Configured by SA1513
dotnet_diagnostic.RCS0007.severity = none

# Add empty line between block and statement
# - Configured by SA1513
dotnet_diagnostic.RCS0008.severity = none

# Add empty line between declaration and documentation comment
# - Configured by SA1516
dotnet_diagnostic.RCS0009.severity = none

# Add empty line between declarations
# - Configured by SA1516
dotnet_diagnostic.RCS0010.severity = none

# Add/remove blank line between single-line accessors
dotnet_diagnostic.RCS0011.severity = warning
roslynator_blank_line_between_single_line_accessors = false

# Add empty line between single-line declarations
# - Configured by SA1513
dotnet_diagnostic.RCS0012.severity = none

# Add empty line between single-line declarations of different kind
# - Configured by SA1513
dotnet_diagnostic.RCS0013.severity = none

# Add empty line between switch sections
dotnet_diagnostic.RCS0014.severity = none

# Add/remove blank line between using directives
dotnet_diagnostic.RCS0015.severity = warning
roslynator_blank_line_between_using_directives = never
# - VS2019 Compatibility
roslynator.RCS0015.invert = true

# Add newline after attribute list
dotnet_diagnostic.RCS0016.severity = warning

# Add newline after opening brace of accessor
dotnet_diagnostic.RCS0020.severity = none

# Format single-line block
# - Configured by SA1502
dotnet_diagnostic.RCS0021.severity = none

# Add newline after opening brace of empty block
# - Configured by SA1502
dotnet_diagnostic.RCS0022.severity = none

# Format declaration braces
# - Configured by SA1502
dotnet_diagnostic.RCS0023.severity = none

# Add new line after switch label
dotnet_diagnostic.RCS0024.severity = warning

# Add newline before accessor of full property
# - Configured by SA1502
dotnet_diagnostic.RCS0025.severity = none

# Add newline before binary operator instead of after it
dotnet_diagnostic.RCS0027.severity = none

# Place new line after/before '?:' operator
dotnet_diagnostic.RCS0028.severity = warning
roslynator_conditional_operator_new_line = before

# Add newline before constructor initializer
dotnet_diagnostic.RCS0029.severity = none

# Add new line before embedded statement
# - Configured by Visual Studio
dotnet_diagnostic.RCS0030.severity = none

# Add new line before enum member
# - Configured by SA1136
dotnet_diagnostic.RCS0031.severity = none

# Add newline before expression-body arrow instead of after it (or vice versa)
dotnet_diagnostic.RCS0032.severity = none

# Add new line before statement
# - Configured by SA1502
dotnet_diagnostic.RCS0033.severity = none

# Add newline before type parameter constraint
dotnet_diagnostic.RCS0034.severity = none

# Remove empty line between single-line declarations of same kind
dotnet_diagnostic.RCS0036.severity = none

# Remove empty line between using directives with same root namespace
dotnet_diagnostic.RCS0038.severity = warning

# Remove newline between 'if' keyword and 'else' keyword
dotnet_diagnostic.RCS0039.severity = none

# Remove newline before base list
dotnet_diagnostic.RCS0041.severity = none

# Remove newlines from accessor list of auto-property
# - Configured by SA1502
dotnet_diagnostic.RCS0042.severity = none

# Remove newlines from accessor with single-line expression
# - Configured by SA1502
dotnet_diagnostic.RCS0043.severity = none

# Use carriage return + linefeed as newline
# - Configured by Visual Studio
dotnet_diagnostic.RCS0044.severity = none

# Use linefeed as newline
# - Configured by Visual Studio
dotnet_diagnostic.RCS0045.severity = none

# Use space(s) instead of tab
# - Configured by Visual Studio
dotnet_diagnostic.RCS0046.severity = none

# Remove newlines from initializer with single-line expression
dotnet_diagnostic.RCS0048.severity = none

# Add empty line after top comment
dotnet_diagnostic.RCS0049.severity = warning

# Add empty line before top declaration
# - Configured by SA1516
dotnet_diagnostic.RCS0050.severity = none

# Add newline between closing brace and 'while' keyword (or vice versa)
# - Configured by SA1500
dotnet_diagnostic.RCS0051.severity = none

# Place new line after equals token
dotnet_diagnostic.RCS0052.severity = warning
roslynator_equals_token_new_line = after
# - VS2019 Compatibility
roslynator.RCS0052.invert = true

# Fix formatting of a list
# - Configured by Visual Studio and StyleCop
dotnet_diagnostic.RCS0053.severity = none

# Fix formatting of a call chain
dotnet_diagnostic.RCS0054.severity = warning

# Fix formatting of a binary expression chain
dotnet_diagnostic.RCS0055.severity = warning

# A line is too long
dotnet_diagnostic.RCS0056.severity = warning
roslynator_max_line_length = 140
# - VS2019 Compatibility
roslynator.max_line_length = 140

# Normalize whitespace at the beginning of a file
dotnet_diagnostic.RCS0057.severity = warning

# Normalize whitespace at the end of a file
# - Configured by Visual Studio
dotnet_diagnostic.RCS0058.severity = none

# Place new line before null-conditional operator
dotnet_diagnostic.RCS0059.severity = warning
roslynator_null_conditional_operator_new_line = before