.editorconfig 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. # Remove the line below if you want to inherit .editorconfig settings from higher directories
  2. root = true
  3. [*]
  4. #### Core EditorConfig Options ####
  5. # Indentation and spacing
  6. indent_size = 4
  7. indent_style = space
  8. tab_width = 4
  9. # New line preferences
  10. end_of_line = lf
  11. insert_final_newline = true
  12. # C# files
  13. [*.cs]
  14. #### .NET Coding Conventions ####
  15. # Organize usings
  16. dotnet_separate_import_directive_groups = false
  17. dotnet_sort_system_directives_first = false
  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_prefer_auto_properties = true:silent
  40. dotnet_style_prefer_compound_assignment = true:suggestion
  41. dotnet_style_prefer_conditional_expression_over_assignment = true:silent
  42. dotnet_style_prefer_conditional_expression_over_return = true:silent
  43. dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
  44. dotnet_style_prefer_inferred_tuple_names = true:suggestion
  45. dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
  46. dotnet_style_prefer_simplified_interpolation = true:suggestion
  47. # Field preferences
  48. dotnet_style_readonly_field = true:suggestion
  49. # Parameter preferences
  50. dotnet_code_quality_unused_parameters = all:silent
  51. #### C# Coding Conventions ####
  52. # Namespace preferences
  53. csharp_style_namespace_declarations = block_scoped:warning
  54. resharper_csharp_namespace_body = block_scoped
  55. # var preferences
  56. csharp_style_var_elsewhere = false:silent
  57. csharp_style_var_for_built_in_types = false:silent
  58. csharp_style_var_when_type_is_apparent = false:silent
  59. # Expression-bodied members
  60. csharp_style_expression_bodied_accessors = true:silent
  61. csharp_style_expression_bodied_constructors = false:silent
  62. csharp_style_expression_bodied_indexers = true:silent
  63. csharp_style_expression_bodied_lambdas = true:silent
  64. csharp_style_expression_bodied_local_functions = false:silent
  65. csharp_style_expression_bodied_methods = false:silent
  66. csharp_style_expression_bodied_operators = false:silent
  67. csharp_style_expression_bodied_properties = true:silent
  68. # Pattern matching preferences
  69. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  70. csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
  71. csharp_style_prefer_switch_expression = false:silent
  72. # Null-checking preferences
  73. csharp_style_conditional_delegate_call = true:suggestion
  74. # Modifier preferences
  75. csharp_prefer_static_local_function = true:suggestion
  76. csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
  77. csharp_style_prefer_readonly_struct = true
  78. csharp_style_prefer_method_group_conversion = true
  79. # Code-block preferences
  80. csharp_prefer_braces = true:silent
  81. csharp_prefer_simple_using_statement = true:suggestion
  82. # Expression-level preferences
  83. csharp_prefer_simple_default_expression = true:suggestion
  84. csharp_style_deconstructed_variable_declaration = true:suggestion
  85. csharp_style_inlined_variable_declaration = true:suggestion
  86. csharp_style_pattern_local_over_anonymous_function = true:suggestion
  87. csharp_style_prefer_index_operator = true:suggestion
  88. csharp_style_prefer_range_operator = true:suggestion
  89. csharp_style_throw_expression = true:suggestion
  90. csharp_style_unused_value_assignment_preference = discard_variable:suggestion
  91. csharp_style_unused_value_expression_statement_preference = discard_variable:silent
  92. csharp_style_implicit_object_creation_when_type_is_apparent = true
  93. # 'using' directive preferences
  94. csharp_using_directive_placement = outside_namespace:silent
  95. #### C# Formatting Rules ####
  96. # New line preferences
  97. csharp_new_line_before_catch = true
  98. csharp_new_line_before_else = true
  99. csharp_new_line_before_finally = true
  100. csharp_new_line_before_members_in_anonymous_types = true
  101. csharp_new_line_before_members_in_object_initializers = true
  102. csharp_new_line_before_open_brace = all
  103. csharp_new_line_between_query_expression_clauses = true
  104. # Indentation preferences
  105. csharp_indent_block_contents = true
  106. csharp_indent_braces = false
  107. csharp_indent_case_contents = true
  108. csharp_indent_case_contents_when_block = true
  109. csharp_indent_labels = one_less_than_current
  110. csharp_indent_switch_labels = true
  111. # Space preferences
  112. csharp_space_after_cast = false
  113. csharp_space_after_colon_in_inheritance_clause = true
  114. csharp_space_after_comma = true
  115. csharp_space_after_dot = false
  116. csharp_space_after_keywords_in_control_flow_statements = true
  117. csharp_space_after_semicolon_in_for_statement = true
  118. csharp_space_around_binary_operators = before_and_after
  119. csharp_space_before_colon_in_inheritance_clause = true
  120. csharp_space_before_comma = false
  121. csharp_space_before_dot = false
  122. csharp_space_before_open_square_brackets = false
  123. csharp_space_before_semicolon_in_for_statement = false
  124. csharp_space_between_empty_square_brackets = false
  125. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  126. csharp_space_between_method_call_name_and_opening_parenthesis = false
  127. csharp_space_between_method_call_parameter_list_parentheses = false
  128. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  129. csharp_space_between_method_declaration_name_and_open_parenthesis = false
  130. csharp_space_between_method_declaration_parameter_list_parentheses = false
  131. csharp_space_between_parentheses = false
  132. csharp_space_between_square_brackets = false
  133. # Wrapping preferences
  134. csharp_preserve_single_line_blocks = true
  135. csharp_preserve_single_line_statements = false
  136. #### Naming styles ####
  137. # Naming rules
  138. dotnet_naming_rule.interfaces_should_be_prefixed_with_I.severity = suggestion
  139. dotnet_naming_rule.interfaces_should_be_prefixed_with_I.symbols = interface
  140. dotnet_naming_rule.interfaces_should_be_prefixed_with_I.style = IPascalCase
  141. dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
  142. dotnet_naming_rule.types_should_be_pascal_case.symbols = types
  143. dotnet_naming_rule.types_should_be_pascal_case.style = PascalCase
  144. dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
  145. dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
  146. dotnet_naming_rule.non_field_members_should_be_pascal_case.style = PascalCase
  147. dotnet_naming_rule.private_static_readonly_fields_should_be_camel_case_and_prefixed_with__.symbols = private_static_readonly_fields
  148. dotnet_naming_rule.private_static_readonly_fields_should_be_camel_case_and_prefixed_with__.severity = suggestion
  149. dotnet_naming_rule.private_static_readonly_fields_should_be_camel_case_and_prefixed_with__.style = _camelCase
  150. dotnet_naming_rule.local_constants_should_be_pascal_case.symbols = local_constants
  151. dotnet_naming_rule.local_constants_should_be_pascal_case.severity = suggestion
  152. dotnet_naming_rule.local_constants_should_be_pascal_case.style = PascalCase
  153. # Symbol specifications
  154. dotnet_naming_symbols.interface.applicable_kinds = interface
  155. dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  156. dotnet_naming_symbols.interface.required_modifiers =
  157. dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
  158. dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  159. dotnet_naming_symbols.types.required_modifiers =
  160. dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
  161. dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  162. dotnet_naming_symbols.non_field_members.required_modifiers =
  163. dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
  164. dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
  165. dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly
  166. dotnet_naming_symbols.local_constants.applicable_kinds = local
  167. dotnet_naming_symbols.local_constants.applicable_accessibilities = local
  168. dotnet_naming_symbols.local_constants.required_modifiers = const
  169. # Naming styles
  170. dotnet_naming_style._camelCase.required_prefix = _
  171. dotnet_naming_style._camelCase.required_suffix =
  172. dotnet_naming_style._camelCase.word_separator =
  173. dotnet_naming_style._camelCase.capitalization = camel_case
  174. dotnet_naming_style.PascalCase.required_prefix =
  175. dotnet_naming_style.PascalCase.required_suffix =
  176. dotnet_naming_style.PascalCase.word_separator =
  177. dotnet_naming_style.PascalCase.capitalization = pascal_case
  178. dotnet_naming_style.IPascalCase.required_prefix = I
  179. dotnet_naming_style.IPascalCase.required_suffix =
  180. dotnet_naming_style.IPascalCase.word_separator =
  181. dotnet_naming_style.IPascalCase.capitalization = pascal_case
  182. [src/Ryujinx.HLE/HOS/Services/**.cs]
  183. # Disable "mark members as static" rule for services
  184. dotnet_diagnostic.CA1822.severity = none
  185. [src/Ryujinx.Ava/UI/ViewModels/**.cs]
  186. # Disable "mark members as static" rule for ViewModels
  187. dotnet_diagnostic.CA1822.severity = none
  188. [src/Ryujinx.Tests/Cpu/*.cs]
  189. # Disable naming rules for CPU tests
  190. dotnet_diagnostic.IDE1006.severity = none