You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

404 line
18KB

  1. root = true
  2. # All files
  3. [*]
  4. indent_style = space
  5. # Xml files
  6. [*.xml]
  7. indent_size = 2
  8. # Xml project files
  9. [*.{csproj,fsproj,vbproj,proj,slnx}]
  10. indent_size = 2
  11. # Xml config files
  12. [*.{props,targets,config,nuspec}]
  13. indent_size = 2
  14. [*.json]
  15. indent_size = 2
  16. # C# files
  17. [*.cs]
  18. #### Core EditorConfig Options ####
  19. # Indentation and spacing
  20. indent_size = 4
  21. tab_width = 4
  22. # New line preferences
  23. insert_final_newline = false
  24. #### .NET Coding Conventions ####
  25. [*.{cs,vb}]
  26. # Organize usings
  27. dotnet_separate_import_directive_groups = true
  28. dotnet_sort_system_directives_first = true
  29. file_header_template = unset
  30. # this. and Me. preferences
  31. dotnet_style_qualification_for_event = false:silent
  32. dotnet_style_qualification_for_field = false:silent
  33. dotnet_style_qualification_for_method = false:silent
  34. dotnet_style_qualification_for_property = false:silent
  35. # Language keywords vs BCL types preferences
  36. dotnet_style_predefined_type_for_locals_parameters_members = true:silent
  37. dotnet_style_predefined_type_for_member_access = true:silent
  38. # Parentheses preferences
  39. dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
  40. dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
  41. dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
  42. dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
  43. # Modifier preferences
  44. dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
  45. # Expression-level preferences
  46. dotnet_style_coalesce_expression = true:suggestion
  47. dotnet_style_collection_initializer = true:suggestion
  48. dotnet_style_explicit_tuple_names = true:suggestion
  49. dotnet_style_namespace_match_folder = true:suggestion
  50. dotnet_style_null_propagation = true:suggestion
  51. dotnet_style_object_initializer = true:suggestion
  52. dotnet_style_operator_placement_when_wrapping = beginning_of_line
  53. dotnet_style_prefer_auto_properties = true:suggestion
  54. dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
  55. dotnet_style_prefer_compound_assignment = true:suggestion
  56. dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
  57. dotnet_style_prefer_conditional_expression_over_return = true:suggestion
  58. dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed:suggestion
  59. dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
  60. dotnet_style_prefer_inferred_tuple_names = true:suggestion
  61. dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
  62. dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
  63. dotnet_style_prefer_simplified_interpolation = true:suggestion
  64. # Field preferences
  65. dotnet_style_readonly_field = true:warning
  66. # Parameter preferences
  67. dotnet_code_quality_unused_parameters = all:suggestion
  68. # Suppression preferences
  69. dotnet_remove_unnecessary_suppression_exclusions = none
  70. #### C# Coding Conventions ####
  71. [*.cs]
  72. # var preferences
  73. csharp_style_var_elsewhere = false:silent
  74. csharp_style_var_for_built_in_types = false:silent
  75. csharp_style_var_when_type_is_apparent = false:silent
  76. # Expression-bodied members
  77. csharp_style_expression_bodied_accessors = true:silent
  78. csharp_style_expression_bodied_constructors = false:silent
  79. csharp_style_expression_bodied_indexers = true:silent
  80. csharp_style_expression_bodied_lambdas = true:suggestion
  81. csharp_style_expression_bodied_local_functions = false:silent
  82. csharp_style_expression_bodied_methods = false:silent
  83. csharp_style_expression_bodied_operators = false:silent
  84. csharp_style_expression_bodied_properties = true:silent
  85. # Pattern matching preferences
  86. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  87. csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
  88. csharp_style_prefer_extended_property_pattern = true:suggestion
  89. csharp_style_prefer_not_pattern = true:suggestion
  90. csharp_style_prefer_pattern_matching = true:silent
  91. csharp_style_prefer_switch_expression = true:suggestion
  92. # Null-checking preferences
  93. csharp_style_conditional_delegate_call = true:suggestion
  94. # Modifier preferences
  95. csharp_prefer_static_anonymous_function = true:suggestion
  96. csharp_prefer_static_local_function = true:warning
  97. csharp_preferred_modifier_order = public,private,protected,internal,file,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
  98. csharp_style_prefer_readonly_struct = true:suggestion
  99. csharp_style_prefer_readonly_struct_member = true:suggestion
  100. # Code-block preferences
  101. csharp_prefer_braces = true:silent
  102. csharp_prefer_simple_using_statement = true:suggestion
  103. csharp_style_namespace_declarations = file_scoped:suggestion
  104. csharp_style_prefer_method_group_conversion = true:silent
  105. csharp_style_prefer_primary_constructors = true:suggestion
  106. csharp_style_prefer_top_level_statements = true:silent
  107. # Expression-level preferences
  108. csharp_prefer_simple_default_expression = true:suggestion
  109. csharp_style_deconstructed_variable_declaration = true:suggestion
  110. csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
  111. csharp_style_inlined_variable_declaration = true:suggestion
  112. csharp_style_prefer_index_operator = true:suggestion
  113. csharp_style_prefer_local_over_anonymous_function = true:suggestion
  114. csharp_style_prefer_null_check_over_type_check = true:suggestion
  115. csharp_style_prefer_range_operator = true:suggestion
  116. csharp_style_prefer_tuple_swap = true:suggestion
  117. csharp_style_prefer_utf8_string_literals = true:suggestion
  118. csharp_style_throw_expression = true:suggestion
  119. csharp_style_unused_value_assignment_preference = discard_variable:suggestion
  120. csharp_style_unused_value_expression_statement_preference = discard_variable:silent
  121. # 'using' directive preferences
  122. csharp_using_directive_placement = outside_namespace:silent
  123. #### C# Formatting Rules ####
  124. # New line preferences
  125. csharp_new_line_before_catch = true
  126. csharp_new_line_before_else = true
  127. csharp_new_line_before_finally = true
  128. csharp_new_line_before_members_in_anonymous_types = true
  129. csharp_new_line_before_members_in_object_initializers = true
  130. csharp_new_line_before_open_brace = all
  131. csharp_new_line_between_query_expression_clauses = true
  132. # Indentation preferences
  133. csharp_indent_block_contents = true
  134. csharp_indent_braces = false
  135. csharp_indent_case_contents = true
  136. csharp_indent_case_contents_when_block = true
  137. csharp_indent_labels = one_less_than_current
  138. csharp_indent_switch_labels = true
  139. # Space preferences
  140. csharp_space_after_cast = false
  141. csharp_space_after_colon_in_inheritance_clause = true
  142. csharp_space_after_comma = true
  143. csharp_space_after_dot = false
  144. csharp_space_after_keywords_in_control_flow_statements = true
  145. csharp_space_after_semicolon_in_for_statement = true
  146. csharp_space_around_binary_operators = before_and_after
  147. csharp_space_around_declaration_statements = false
  148. csharp_space_before_colon_in_inheritance_clause = true
  149. csharp_space_before_comma = false
  150. csharp_space_before_dot = false
  151. csharp_space_before_open_square_brackets = false
  152. csharp_space_before_semicolon_in_for_statement = false
  153. csharp_space_between_empty_square_brackets = false
  154. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  155. csharp_space_between_method_call_name_and_opening_parenthesis = false
  156. csharp_space_between_method_call_parameter_list_parentheses = false
  157. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  158. csharp_space_between_method_declaration_name_and_open_parenthesis = false
  159. csharp_space_between_method_declaration_parameter_list_parentheses = false
  160. csharp_space_between_parentheses = false
  161. csharp_space_between_square_brackets = false
  162. # Wrapping preferences
  163. csharp_preserve_single_line_blocks = true
  164. csharp_preserve_single_line_statements = true
  165. #### Naming styles ####
  166. [*.{cs,vb}]
  167. # Naming rules
  168. dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion
  169. dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces
  170. dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase
  171. dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion
  172. dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces
  173. dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase
  174. dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion
  175. dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters
  176. dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase
  177. dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion
  178. dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods
  179. dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase
  180. dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion
  181. dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties
  182. dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase
  183. dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion
  184. dotnet_naming_rule.events_should_be_pascalcase.symbols = events
  185. dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase
  186. dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion
  187. dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables
  188. dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase
  189. dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion
  190. dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants
  191. dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase
  192. dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion
  193. dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters
  194. dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase
  195. dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion
  196. dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields
  197. dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase
  198. dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion
  199. dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields
  200. dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase
  201. dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion
  202. dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields
  203. dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase
  204. dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion
  205. dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields
  206. dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase
  207. dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion
  208. dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields
  209. dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase
  210. dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion
  211. dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields
  212. dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase
  213. dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion
  214. dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields
  215. dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase
  216. dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion
  217. dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums
  218. dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase
  219. dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion
  220. dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions
  221. dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase
  222. dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion
  223. dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members
  224. dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase
  225. # Symbol specifications
  226. dotnet_naming_symbols.interfaces.applicable_kinds = interface
  227. dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  228. dotnet_naming_symbols.interfaces.required_modifiers =
  229. dotnet_naming_symbols.enums.applicable_kinds = enum
  230. dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  231. dotnet_naming_symbols.enums.required_modifiers =
  232. dotnet_naming_symbols.events.applicable_kinds = event
  233. dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  234. dotnet_naming_symbols.events.required_modifiers =
  235. dotnet_naming_symbols.methods.applicable_kinds = method
  236. dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  237. dotnet_naming_symbols.methods.required_modifiers =
  238. dotnet_naming_symbols.properties.applicable_kinds = property
  239. dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  240. dotnet_naming_symbols.properties.required_modifiers =
  241. dotnet_naming_symbols.public_fields.applicable_kinds = field
  242. dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal
  243. dotnet_naming_symbols.public_fields.required_modifiers =
  244. dotnet_naming_symbols.private_fields.applicable_kinds = field
  245. dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
  246. dotnet_naming_symbols.private_fields.required_modifiers =
  247. dotnet_naming_symbols.private_static_fields.applicable_kinds = field
  248. dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
  249. dotnet_naming_symbols.private_static_fields.required_modifiers = static
  250. dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum
  251. dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  252. dotnet_naming_symbols.types_and_namespaces.required_modifiers =
  253. dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
  254. dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
  255. dotnet_naming_symbols.non_field_members.required_modifiers =
  256. dotnet_naming_symbols.type_parameters.applicable_kinds = namespace
  257. dotnet_naming_symbols.type_parameters.applicable_accessibilities = *
  258. dotnet_naming_symbols.type_parameters.required_modifiers =
  259. dotnet_naming_symbols.private_constant_fields.applicable_kinds = field
  260. dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
  261. dotnet_naming_symbols.private_constant_fields.required_modifiers = const
  262. dotnet_naming_symbols.local_variables.applicable_kinds = local
  263. dotnet_naming_symbols.local_variables.applicable_accessibilities = local
  264. dotnet_naming_symbols.local_variables.required_modifiers =
  265. dotnet_naming_symbols.local_constants.applicable_kinds = local
  266. dotnet_naming_symbols.local_constants.applicable_accessibilities = local
  267. dotnet_naming_symbols.local_constants.required_modifiers = const
  268. dotnet_naming_symbols.parameters.applicable_kinds = parameter
  269. dotnet_naming_symbols.parameters.applicable_accessibilities = *
  270. dotnet_naming_symbols.parameters.required_modifiers =
  271. dotnet_naming_symbols.public_constant_fields.applicable_kinds = field
  272. dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal
  273. dotnet_naming_symbols.public_constant_fields.required_modifiers = const
  274. dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field
  275. dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal
  276. dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static
  277. dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
  278. dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
  279. dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static
  280. dotnet_naming_symbols.local_functions.applicable_kinds = local_function
  281. dotnet_naming_symbols.local_functions.applicable_accessibilities = *
  282. dotnet_naming_symbols.local_functions.required_modifiers =
  283. # Naming styles
  284. dotnet_naming_style.pascalcase.required_prefix =
  285. dotnet_naming_style.pascalcase.required_suffix =
  286. dotnet_naming_style.pascalcase.word_separator =
  287. dotnet_naming_style.pascalcase.capitalization = pascal_case
  288. dotnet_naming_style.ipascalcase.required_prefix = I
  289. dotnet_naming_style.ipascalcase.required_suffix =
  290. dotnet_naming_style.ipascalcase.word_separator =
  291. dotnet_naming_style.ipascalcase.capitalization = pascal_case
  292. dotnet_naming_style.tpascalcase.required_prefix = T
  293. dotnet_naming_style.tpascalcase.required_suffix =
  294. dotnet_naming_style.tpascalcase.word_separator =
  295. dotnet_naming_style.tpascalcase.capitalization = pascal_case
  296. dotnet_naming_style._camelcase.required_prefix = _
  297. dotnet_naming_style._camelcase.required_suffix =
  298. dotnet_naming_style._camelcase.word_separator =
  299. dotnet_naming_style._camelcase.capitalization = camel_case
  300. dotnet_naming_style.camelcase.required_prefix =
  301. dotnet_naming_style.camelcase.required_suffix =
  302. dotnet_naming_style.camelcase.word_separator =
  303. dotnet_naming_style.camelcase.capitalization = camel_case
  304. dotnet_naming_style.s_camelcase.required_prefix = s_
  305. dotnet_naming_style.s_camelcase.required_suffix =
  306. dotnet_naming_style.s_camelcase.word_separator =
  307. dotnet_naming_style.s_camelcase.capitalization = camel_case
  308. # Test method names use the xUnit/NUnit Method_Scenario_Expected convention.
  309. [tests/**.cs]
  310. dotnet_diagnostic.CA1707.severity = none
  311. # Result<T>.Success/Failure static factory methods are the intended API shape (common
  312. # pattern, e.g. FluentResults/ErrorOr) despite CA1000's general "avoid static members on
  313. # generic types" guidance.
  314. [src/CartWise.Application/Results/**.cs]
  315. dotnet_diagnostic.CA1000.severity = none
  316. # EF Core generates migrations; don't hand-edit generated code to satisfy analyzers.
  317. [src/CartWise.Infrastructure/Data/Migrations/**.cs]
  318. dotnet_diagnostic.CA1861.severity = none

Powered by TurnKey Linux.