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.

90 lines
4.5 KiB

  1. # Rules in this file were initially inferred by Visual Studio IntelliCode from the F:\Web Samples\GitHub\eShopOnContainers codebase based on best match to current usage at 4/4/2019
  2. # You can modify the rules from these initially generated values to suit your own policies
  3. # You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
  4. [*.cs]
  5. #Core editorconfig formatting - indentation
  6. #use soft tabs (spaces) for indentation
  7. indent_style = space
  8. #Formatting - new line options
  9. #place catch statements on a new line
  10. csharp_new_line_before_catch = true
  11. #place else statements on a new line
  12. csharp_new_line_before_else = true
  13. #require braces to be on a new line for methods, control_blocks, types, anonymous_types, lambdas, and object_collection_array_initializers (also known as "Allman" style)
  14. csharp_new_line_before_open_brace = methods, control_blocks, types, anonymous_types, lambdas, object_collection_array_initializers
  15. #Formatting - organize using options
  16. #do not place System.* using directives before other using directives
  17. dotnet_sort_system_directives_first = false
  18. #Formatting - spacing options
  19. #require NO space between a cast and the value
  20. csharp_space_after_cast = false
  21. #require a space before the colon for bases or interfaces in a type declaration
  22. csharp_space_after_colon_in_inheritance_clause = true
  23. #require a space after a keyword in a control flow statement such as a for loop
  24. csharp_space_after_keywords_in_control_flow_statements = true
  25. #require a space before the colon for bases or interfaces in a type declaration
  26. csharp_space_before_colon_in_inheritance_clause = true
  27. #remove space within empty argument list parentheses
  28. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  29. #remove space between method call name and opening parenthesis
  30. csharp_space_between_method_call_name_and_opening_parenthesis = false
  31. #do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
  32. csharp_space_between_method_call_parameter_list_parentheses = false
  33. #remove space within empty parameter list parentheses for a method declaration
  34. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  35. #place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
  36. csharp_space_between_method_declaration_parameter_list_parentheses = false
  37. #Formatting - wrapping options
  38. #leave code block on single line
  39. csharp_preserve_single_line_blocks = true
  40. #leave statements and member declarations on the same line
  41. csharp_preserve_single_line_statements = true
  42. #Style - expression bodied member options
  43. #prefer block bodies for accessors
  44. csharp_style_expression_bodied_accessors = false:suggestion
  45. #prefer block bodies for constructors
  46. csharp_style_expression_bodied_constructors = false:suggestion
  47. #prefer block bodies for methods
  48. csharp_style_expression_bodied_methods = false:suggestion
  49. #prefer expression-bodied members for properties
  50. csharp_style_expression_bodied_properties = true:suggestion
  51. #Style - expression level options
  52. #prefer out variables to be declared inline in the argument list of a method call when possible
  53. csharp_style_inlined_variable_declaration = true:suggestion
  54. #prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
  55. dotnet_style_predefined_type_for_member_access = true:suggestion
  56. #Style - implicit and explicit types
  57. #prefer var is used to declare variables with built-in system types such as int
  58. csharp_style_var_for_built_in_types = true:suggestion
  59. #prefer var when the type is already mentioned on the right-hand side of a declaration expression
  60. csharp_style_var_when_type_is_apparent = true:suggestion
  61. #Style - language keyword and framework type options
  62. #prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
  63. dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
  64. #Style - qualification options
  65. #prefer fields not to be prefaced with this. or Me. in Visual Basic
  66. dotnet_style_qualification_for_field = false:suggestion
  67. #prefer methods not to be prefaced with this. or Me. in Visual Basic
  68. dotnet_style_qualification_for_method = false:suggestion
  69. #prefer properties not to be prefaced with this. or Me. in Visual Basic
  70. dotnet_style_qualification_for_property = false:suggestion