dotnet / format

Home for the dotnet-format command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Formatting rule (IDE0055)] Passes locally but fails in AWS CodeBuild

JCKortlang opened this issue · comments

Details

EnforceCodeStyleInBuild=true enabled solution with .editorconfig is successfully formatted locally and pushed to my company's internal git repository which is then replicated into AWS CodeCommit. The AWS CodeCommit source code is then pulled into AWS CodeBuild for release.

The build fails in AWS CodeBuild due to violations of IDE0055.

Triage / Investigation

  1. Replicated CodeBuild using ubuntu/standard/6.0 and ubuntu/standard/7.0 --> Build passes in my local container
  2. Updated SDK --> No change

SDK

dotnet --version
7.0.400

dotnet format --version
7.4.431902+3c30490bb2ecae8967a3b5e79c97ab98de334676

Mitigation

Set IDE0055 to 'warn'.

Root Cause

Unknown. I suspect formatting changes to the files between the repository systems.

Ask / Question

Mainly posting this issue to documented it but I am curious as to others input.

  1. Can anything be done to mitigate these unexpected changes?
    1. e.g. Dump formatting diagnostics.
      --

##.editorconfig

# https://editorconfig.org/
#
# Code Analysis - https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview
#   - Quality Rules - https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
#   - Style Rules - https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/
#
# A "rule" may have [0..n] "options" and each option may have [2..n] valid values.
#   - Severity can be configured at the rule and option level, however the option level severity may or may not be supported by a given IDE / environment per the docs.
#       - i.e. 'dotnet_diagnostic.<rule_id>.severity = <severity>' vs. '<option_name> = <value>:<severity>'
#       - e.g. https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0003-ide0009
#           1. dotnet_diagnostic.IDE0003.severity = error
#           2. dotnet_style_qualification_for_field = true:error
#   - We need to configure BOTH. MSBuild uses (1). Rider uses (2). -- https://github.com/dotnet/roslyn/issues/44201

# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true

# General formatting properties
[*]
charset = utf-8-bom
end_of_line = crlf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.cs]
# .NET Format Rules
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0055
# 'warning' because formatting is failing in CodeBuild. Likely due to file format differences
## ALL format rules / options use IDE0055
dotnet_diagnostic.IDE0055.severity = warning

## dotnet_*
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/dotnet-formatting-options
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true

## csharp_*
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options

## csharp_new_line_*
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options#new-line-options
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true

## csharp_indent_*
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options#indentation-options
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true

## csharp_space_*
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options#spacing-options
csharp_space_after_cast = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_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_declaration_parameter_list_parentheses = false
csharp_space_between_square_brackets = false

## csharp_preserve_*
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options#wrap-options
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true

# Language and Unnecessary Rules
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/language-rules

## Simplify name
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0001
dotnet_diagnostic.IDE0001.severity = error

## Simplify member access
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0002
dotnet_diagnostic.IDE0002.severity = error

## 'this.' qualifier
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0003-ide0009
dotnet_diagnostic.IDE0003.severity = none
dotnet_diagnostic.IDE0009.severity = error
dotnet_style_qualification_for_event = true:error
dotnet_style_qualification_for_field = true:error
dotnet_style_qualification_for_method = true:error
dotnet_style_qualification_for_property = true:error

## Remove unnecessary cast
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0004
dotnet_diagnostic.IDE0004.severity = error

## Remove unnecessary using directives
## 'suggestion' because detection of 'unused' is buggy and may cause incorrect removal
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005
dotnet_diagnostic.IDE0005.severity = suggestion

## 'var' preferences
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0007-ide0008
dotnet_diagnostic.IDE0007.severity = error
dotnet_diagnostic.IDE0008.severity = error
csharp_style_var_elsewhere = false:error
csharp_style_var_for_built_in_types = false:error
csharp_style_var_when_type_is_apparent = true:error

## Add missing cases to switch statement
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0010
dotnet_diagnostic.IDE0010.severity = error

## Add braces
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0011
dotnet_diagnostic.IDE0011.severity = error
csharp_prefer_braces = true:error

## Use throw expression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0016
dotnet_diagnostic.IDE0016.severity = error
csharp_style_throw_expression = true:error

## Use object initializers
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0017
dotnet_diagnostic.IDE0017.severity = error
dotnet_style_object_initializer = true:error

## Inline variable declaration
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0018
dotnet_diagnostic.IDE0018.severity = error
csharp_style_inlined_variable_declaration = true:error

## Use pattern matching to avoid 'as' followed by a 'null' check
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0019
dotnet_diagnostic.IDE0019.severity = error
csharp_style_pattern_matching_over_as_with_null_check = true:error

## Use pattern matching to avoid 'is' check followed by a cast
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0020-ide0038
dotnet_diagnostic.IDE0020.severity = error
dotnet_diagnostic.IDE0038.severity = error
csharp_style_pattern_matching_over_is_with_cast_check = true:error

## Use expression body for constructors
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0021
dotnet_diagnostic.IDE0021.severity = error
csharp_style_expression_bodied_constructors = false:error

##  Use expression body for methods
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0022
dotnet_diagnostic.IDE0022.severity = error
csharp_style_expression_bodied_methods = when_on_single_line:error

## Use expression body for operators
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0023-ide0024
dotnet_diagnostic.IDE0023.severity = error
dotnet_diagnostic.IDE0024.severity = error
csharp_style_expression_bodied_operators = when_on_single_line:error

## Use expression body for properties
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0025
dotnet_diagnostic.IDE0025.severity = error
csharp_style_expression_bodied_properties = when_on_single_line:error

## Use expression body for indexers
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0026
dotnet_diagnostic.IDE0026.severity = error
csharp_style_expression_bodied_indexers = when_on_single_line:error

## Use expression body for accessors
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0027
dotnet_diagnostic.IDE0027.severity = error
csharp_style_expression_bodied_accessors = when_on_single_line:error

## Use collection initializers
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0028
dotnet_diagnostic.IDE0028.severity = error
dotnet_style_collection_initializer = true:error

## Null check can be simplified
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0029-ide0030-ide0270
dotnet_diagnostic.IDE0029.severity = error
dotnet_diagnostic.IDE0030.severity = error
dotnet_diagnostic.IDE0270.severity = error
dotnet_style_coalesce_expression = true:error

## Use null propagation
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0031
dotnet_diagnostic.IDE0031.severity = error
dotnet_style_null_propagation = true:error

## Use auto-implemented property
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0032
dotnet_diagnostic.IDE0032.severity = error
dotnet_style_prefer_auto_properties = true:error

## Use explicitly provided tuple name
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0033
dotnet_diagnostic.IDE0033.severity = error
dotnet_style_explicit_tuple_names = true:error

## Simplify 'default' expression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0034
dotnet_diagnostic.IDE0034.severity = error
csharp_prefer_simple_default_expression = true:error

## Remove unreachable code
## 'suggestion' because detection of 'unreachable' is buggy and may cause incorrect removal
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0035
dotnet_diagnostic.IDE0035.severity = suggestion

## Order modifiers
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036
dotnet_diagnostic.IDE0036.severity = error
csharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async:error

## Use inferred member names
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0037
dotnet_diagnostic.IDE0037.severity = error
dotnet_style_prefer_inferred_tuple_names = true:error
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error

## Use local function instead of lambda
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0039
dotnet_diagnostic.IDE0039.severity = error
csharp_style_prefer_local_over_anonymous_function = true:error

## Add accessibility modifiers
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0040
dotnet_diagnostic.IDE0040.severity = error
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error

## Use 'is null' check
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0041
dotnet_diagnostic.IDE0041.severity = error
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error

## Deconstruct variable declaration
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0042
dotnet_diagnostic.IDE0042.severity = error
csharp_style_deconstructed_variable_declaration = true:error

## Add readonly modifier
## 'suggestion' because the rule recommends marking mutated reference types as readonly
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0044
dotnet_diagnostic.IDE0044.severity = suggestion
dotnet_style_readonly_field = true:suggestion

## Use conditional expression for assignment
## 'suggestion' because it results in multi-line ternary operations
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0045
dotnet_diagnostic.IDE0045.severity = suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion

## Use conditional expression for return
## 'suggestion' because it results in multi-line ternary operations
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0046
dotnet_diagnostic.IDE0046.severity = suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion

## Parentheses preferences
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048
dotnet_diagnostic.IDE0047.severity = error
dotnet_diagnostic.IDE0048.severity = error
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:error
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:error
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error

## Use language keywords instead of framework type names for type references
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0049
dotnet_diagnostic.IDE0049.severity = error
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error

## Convert anonymous type to tuple
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0050
dotnet_diagnostic.IDE0050.severity = error

# Remove unused private member
## 'suggestion' because detection of 'unused' is buggy and may cause incorrect removal
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0051
dotnet_diagnostic.IDE0051.severity = suggestion

## Remove unread private member
## 'suggestion' because detection of 'unused' is buggy and may cause incorrect removal
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0052
dotnet_diagnostic.IDE0052.severity = suggestion

## Use expression body for lambdas
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0053
dotnet_diagnostic.IDE0053.severity = error
csharp_style_expression_bodied_lambdas = when_on_single_line:error

## Use compound assignment
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0054-ide0074
dotnet_diagnostic.IDE0054.severity = error
dotnet_diagnostic.IDE0074.severity = error
dotnet_style_prefer_compound_assignment = true:error

## Use index operator
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0056
dotnet_diagnostic.IDE0056.severity = error
csharp_style_prefer_index_operator = true:error

## Use range operator
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0057
dotnet_diagnostic.IDE0057.severity = error
csharp_style_prefer_range_operator = true:error

## Remove unnecessary expression value
## 'suggestion' because it makes builder code less readable
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0058
dotnet_diagnostic.IDE0058.severity = suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion

## Remove unnecessary value assignment
## 'suggestion' because it makes builder code less readable
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0059
dotnet_diagnostic.IDE0059.severity = suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion

## Remove unused parameter
## 'suggestion' because detection of 'unused' is buggy and may cause incorrect removal
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0060
dotnet_diagnostic.IDE0060.severity = suggestion
dotnet_code_quality_unused_parameters = non_public:suggestion

## Use expression body for local functions
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0061
dotnet_diagnostic.IDE0061.severity = error
csharp_style_expression_bodied_local_functions = when_on_single_line:error

## Make local function static
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0062
dotnet_diagnostic.IDE0062.severity = error
csharp_prefer_static_local_function = true:error

##  Use simple 'using' statement
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0063
dotnet_diagnostic.IDE0063.severity = error
csharp_prefer_simple_using_statement = true:error

## Make struct fields writable
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0064
dotnet_diagnostic.IDE0064.severity = error

## 'using' directive placement
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0065
dotnet_diagnostic.IDE0065.severity = error
csharp_using_directive_placement = outside_namespace:error

## Use switch expression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0066
dotnet_diagnostic.IDE0066.severity = error
csharp_style_prefer_switch_expression = true:error

## Use 'System.HashCode.Combine'
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0070
dotnet_diagnostic.IDE0070.severity = error

## Simplify interpolation
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0071
dotnet_diagnostic.IDE0071.severity = error
dotnet_style_prefer_simplified_interpolation = true:error

## Add missing cases to switch expression
## 'suggestion' because it generates needless cases
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0072
dotnet_diagnostic.IDE0072.severity = suggestion

## Require file header
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0073
dotnet_diagnostic.IDE0073.severity = error
file_header_template = <redacted>

## Simplify conditional expression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0075
dotnet_diagnostic.IDE0074.severity = error
dotnet_style_prefer_simplified_boolean_expressions = true:error

## Use pattern matching
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0078-ide0260
dotnet_diagnostic.IDE0078.severity = error
dotnet_diagnostic.IDE0260.severity = error
csharp_style_prefer_pattern_matching = true:error
csharp_style_pattern_matching_over_as_with_null_check = true:error

## Remove unnecessary suppression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0079
dotnet_diagnostic.IDE0079.severity = error
dotnet_remove_unnecessary_suppression_exclusions = true:error

## Remove unnecessary suppression operator
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0080
dotnet_diagnostic.IDE0080.severity = error

## Remove ByVal
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0081
dotnet_diagnostic.IDE0081.severity = error

## Convert typeof to nameof
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0082
dotnet_diagnostic.IDE0082.severity = error

## Use pattern matching
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0083
dotnet_diagnostic.IDE0083.severity = error
csharp_style_prefer_not_pattern = true:error

## Simplify new expression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0090
dotnet_diagnostic.IDE0090.severity = error
csharp_style_implicit_object_creation_when_type_is_apparent = true:error

## Remove unnecessary equality operator
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0100
dotnet_diagnostic.IDE0100.severity = none

## Remove unnecessary discard
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0110
dotnet_diagnostic.IDE0110.severity = error

## Simplify LINQ expression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0120
dotnet_diagnostic.IDE0120.severity = error

## Namespace does not match folder structure
## 'suggestion' because we do not use matching namespaces in Lambda
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0130
dotnet_diagnostic.IDE0130.severity = suggestion
dotnet_style_namespace_match_folder = false:suggestion

## Prefer 'null' check over type check
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0150
dotnet_diagnostic.IDE0150.severity = error
csharp_style_prefer_null_check_over_type_check = true:error

## Namespace declaration preferences
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161
dotnet_diagnostic.IDE0160.severity = error
dotnet_diagnostic.IDE0161.severity = none
csharp_style_namespace_declarations = file_scoped:error

## Simplify property pattern
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0170
dotnet_diagnostic.IDE0170.severity = error
csharp_style_prefer_extended_property_pattern = true:error

## Use tuple to swap values
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0180
dotnet_diagnostic.IDE0180.severity = error
csharp_style_prefer_tuple_swap = true:error

## Remove unnecessary lambda expression
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0200
dotnet_diagnostic.IDE0200.severity = error
csharp_style_prefer_method_group_conversion = true

## Convert to top-level statements
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0210
dotnet_diagnostic.IDE0210.severity = error
dotnet_diagnostic.IDE0211.severity = none
csharp_style_prefer_top_level_statements = true:error

## Add explicit cast in foreach loop
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0220
dotnet_diagnostic.IDE0220.severity = error
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed:error

## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0230
dotnet_diagnostic.ide0230.severity = error
csharp_style_prefer_utf8_string_literals = true:error

## Nullable directive is redundant
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0240
dotnet_diagnostic.IDE0240.severity = error

## Nullable directive is unnecessary
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0241
dotnet_diagnostic.IDE0241.severity = error

## Struct can be made 'readonly'
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0250
dotnet_diagnostic.IDE0250.severity = error
csharp_style_prefer_readonly_struct = true:error

## Member can be made 'readonly'
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0251
dotnet_diagnostic.IDE0251.severity = error
csharp_style_prefer_readonly_struct_member = true:error

## Use 'nameof'
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0280
dotnet_diagnostic.IDE0280.severity = error

## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide1005
dotnet_diagnostic.IDE1005.severity = error
csharp_style_conditional_delegate_call = true:error

# Miscellaneous rules
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/miscellaneous-rules

## Remove invalid global 'SuppressMessageAttribute'
## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0076
dotnet_diagnostic.IDE0076.severity = error

## https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0077
dotnet_diagnostic.IDE0077.severity = error


# .NET Naming Rules
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/naming-rules
# Format: <kind>.<entityName>.<propertyName> = <propertyValue>
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/naming-rules#rule-id-ide1006-naming-rule-violation
dotnet_diagnostic.IDE1006.severity = error

dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

dotnet_naming_style.interface_style.capitalization = pascal_case
dotnet_naming_style.interface_style.required_prefix = I

dotnet_naming_style.type_parameter_style.capitalization = pascal_case
dotnet_naming_style.type_parameter_style.required_prefix = T

dotnet_naming_style.async_method_style.capitalization = pascal_case
dotnet_naming_style.async_method_style.required_suffix = Async

dotnet_naming_rule.default_rule.style = pascal_case_style
dotnet_naming_rule.default_rule.severity = error
dotnet_naming_rule.default_rule.symbols = default_rule_symbols
dotnet_naming_symbols.default_rule_symbols.applicable_kinds = namespace,class,struct,enum,property,method,delegate,event

dotnet_naming_rule.local_and_fields_rule.style = camel_case_style
dotnet_naming_rule.local_and_fields_rule.severity = error
dotnet_naming_rule.local_and_fields_rule.symbols = local_and_fields
dotnet_naming_symbols.local_and_fields.applicable_kinds = field,local,parameter

dotnet_naming_rule.interface_rule.style = interface_style
dotnet_naming_rule.interface_rule.severity = error
dotnet_naming_rule.interface_rule.symbols = interface_rule_symbols
dotnet_naming_symbols.interface_rule_symbols.applicable_kinds = interface

dotnet_naming_rule.type_parameter_rule.style = type_parameter_style
dotnet_naming_rule.type_parameter_rule.severity = error
dotnet_naming_rule.type_parameter_rule.symbols = type_parameter_symbols
dotnet_naming_symbols.type_parameter_symbols.applicable_kinds = type_parameter

dotnet_naming_rule.static_const_rule.style = pascal_case_style
dotnet_naming_rule.static_const_rule.severity = error
dotnet_naming_rule.static_const_rule.symbols = static_const_symbols
dotnet_naming_symbols.static_const_symbols.applicable_kinds = field
dotnet_naming_symbols.static_const_symbols.required_modifiers = static

dotnet_naming_rule.async_method_rule.style = async_method_style
dotnet_naming_rule.async_method_rule.severity = error
dotnet_naming_rule.async_method_rule.symbols = async_method_symbols
dotnet_naming_symbols.async_method_symbols.applicable_kinds = method
dotnet_naming_symbols.async_method_symbols.required_modifiers = async

I suspect it has to do with the interplay of the .editorconfig's end_of_line setting and git autocrlf. I would recommend removing the end_of_line settings and configuring .gitattributes to automatically handle this (see https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#per-repository-settings). You will likely need to renormalize line endings if you choose this route (see https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings).

Closing this issue as we've seen no reply to the request for more information. If you are able to get the requested information, please add it to the issue and we will retriage it.