.editorconfig 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. # Remove the line below if you want to inherit .editorconfig settings from higher directories
  2. root = true
  3. # C# files
  4. [*.cs]
  5. #### Core EditorConfig Options ####
  6. # Indentation and spacing
  7. indent_size = 4
  8. indent_style = tab
  9. tab_width = 4
  10. # New line preferences
  11. end_of_line = crlf
  12. insert_final_newline = true
  13. #### .NET Coding Conventions ####
  14. # Organize usings
  15. dotnet_separate_import_directive_groups = false
  16. dotnet_sort_system_directives_first = false
  17. file_header_template = unset
  18. # this. and Me. preferences
  19. dotnet_style_qualification_for_event = false:silent
  20. dotnet_style_qualification_for_field = false:silent
  21. dotnet_style_qualification_for_method = false:silent
  22. dotnet_style_qualification_for_property = false:silent
  23. # Language keywords vs BCL types preferences
  24. dotnet_style_predefined_type_for_locals_parameters_members = true:silent
  25. dotnet_style_predefined_type_for_member_access = true:silent
  26. # Parentheses preferences
  27. dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
  28. dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
  29. dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
  30. dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
  31. # Modifier preferences
  32. dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
  33. # Expression-level preferences
  34. dotnet_style_coalesce_expression = true:suggestion
  35. dotnet_style_collection_initializer = true:suggestion
  36. dotnet_style_explicit_tuple_names = true:suggestion
  37. dotnet_style_null_propagation = true:suggestion
  38. dotnet_style_object_initializer = true:suggestion
  39. dotnet_style_operator_placement_when_wrapping = beginning_of_line
  40. dotnet_style_prefer_auto_properties = true:silent
  41. dotnet_style_prefer_compound_assignment = true:suggestion
  42. dotnet_style_prefer_conditional_expression_over_assignment = true:silent
  43. dotnet_style_prefer_conditional_expression_over_return = true:silent
  44. dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
  45. dotnet_style_prefer_inferred_tuple_names = true:suggestion
  46. dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
  47. dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
  48. dotnet_style_prefer_simplified_interpolation = true:suggestion
  49. # Field preferences
  50. dotnet_style_readonly_field = true:suggestion
  51. # Parameter preferences
  52. dotnet_code_quality_unused_parameters = all:suggestion
  53. #### C# Coding Conventions ####
  54. # var preferences
  55. csharp_style_var_elsewhere = false:silent
  56. csharp_style_var_for_built_in_types = false:silent
  57. csharp_style_var_when_type_is_apparent = false:silent
  58. # Expression-bodied members
  59. csharp_style_expression_bodied_accessors = true:silent
  60. csharp_style_expression_bodied_constructors = false:silent
  61. csharp_style_expression_bodied_indexers = true:silent
  62. csharp_style_expression_bodied_lambdas = true:silent
  63. csharp_style_expression_bodied_local_functions = false:silent
  64. csharp_style_expression_bodied_methods = false:silent
  65. csharp_style_expression_bodied_operators = false:silent
  66. csharp_style_expression_bodied_properties = true:silent
  67. # Pattern matching preferences
  68. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  69. csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
  70. csharp_style_prefer_switch_expression = true:suggestion
  71. # Null-checking preferences
  72. csharp_style_conditional_delegate_call = true:suggestion
  73. # Modifier preferences
  74. csharp_prefer_static_local_function = true:suggestion
  75. csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
  76. # Code-block preferences
  77. csharp_prefer_braces = true:silent
  78. csharp_prefer_simple_using_statement = true:suggestion
  79. # Expression-level preferences
  80. csharp_prefer_simple_default_expression = true:suggestion
  81. csharp_style_deconstructed_variable_declaration = true:suggestion
  82. csharp_style_inlined_variable_declaration = true:suggestion
  83. csharp_style_pattern_local_over_anonymous_function = true:suggestion
  84. csharp_style_prefer_index_operator = true:suggestion
  85. csharp_style_prefer_range_operator = true:suggestion
  86. csharp_style_throw_expression = true:suggestion
  87. csharp_style_unused_value_assignment_preference = discard_variable:suggestion
  88. csharp_style_unused_value_expression_statement_preference = discard_variable:silent
  89. # 'using' directive preferences
  90. csharp_using_directive_placement = outside_namespace:silent
  91. #### C# Formatting Rules ####
  92. # New line preferences
  93. csharp_new_line_before_catch = false
  94. csharp_new_line_before_else = false
  95. csharp_new_line_before_finally = false
  96. csharp_new_line_before_members_in_anonymous_types = true
  97. csharp_new_line_before_members_in_object_initializers = true
  98. csharp_new_line_before_open_brace = none
  99. csharp_new_line_between_query_expression_clauses = true
  100. # Indentation preferences
  101. csharp_indent_block_contents = true
  102. csharp_indent_braces = false
  103. csharp_indent_case_contents = true
  104. csharp_indent_case_contents_when_block = false
  105. csharp_indent_labels = no_change
  106. csharp_indent_switch_labels = false
  107. # Space preferences
  108. csharp_space_after_cast = false
  109. csharp_space_after_colon_in_inheritance_clause = true
  110. csharp_space_after_comma = true
  111. csharp_space_after_dot = false
  112. csharp_space_after_keywords_in_control_flow_statements = true
  113. csharp_space_after_semicolon_in_for_statement = true
  114. csharp_space_around_binary_operators = before_and_after
  115. csharp_space_around_declaration_statements = false
  116. csharp_space_before_colon_in_inheritance_clause = true
  117. csharp_space_before_comma = false
  118. csharp_space_before_dot = false
  119. csharp_space_before_open_square_brackets = false
  120. csharp_space_before_semicolon_in_for_statement = false
  121. csharp_space_between_empty_square_brackets = false
  122. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  123. csharp_space_between_method_call_name_and_opening_parenthesis = false
  124. csharp_space_between_method_call_parameter_list_parentheses = false
  125. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  126. csharp_space_between_method_declaration_name_and_open_parenthesis = true
  127. csharp_space_between_method_declaration_parameter_list_parentheses = false
  128. csharp_space_between_parentheses = false
  129. csharp_space_between_square_brackets = false
  130. # Wrapping preferences
  131. csharp_preserve_single_line_blocks = true
  132. csharp_preserve_single_line_statements = true
  133. #### Naming styles ####
  134. # Naming rules
  135. dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
  136. dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
  137. dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
  138. dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
  139. dotnet_naming_rule.types_should_be_pascal_case.symbols = types
  140. dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
  141. dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
  142. dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
  143. dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
  144. # Symbol specifications
  145. dotnet_naming_symbols.interface.applicable_kinds = interface
  146. dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  147. dotnet_naming_symbols.interface.required_modifiers =
  148. dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
  149. dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  150. dotnet_naming_symbols.types.required_modifiers =
  151. dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
  152. dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  153. dotnet_naming_symbols.non_field_members.required_modifiers =
  154. # Naming styles
  155. dotnet_naming_style.pascal_case.required_prefix =
  156. dotnet_naming_style.pascal_case.required_suffix =
  157. dotnet_naming_style.pascal_case.word_separator =
  158. dotnet_naming_style.pascal_case.capitalization = pascal_case
  159. dotnet_naming_style.begins_with_i.required_prefix = I
  160. dotnet_naming_style.begins_with_i.required_suffix =
  161. dotnet_naming_style.begins_with_i.word_separator =
  162. dotnet_naming_style.begins_with_i.capitalization = pascal_case