.editorconfig 8.1 KB

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