.editorconfig 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # EditorConfig is awesome: https://EditorConfig.org
  2. # Please feel free to update it (by considering the code style of ABP Team).
  3. # top-most EditorConfig file
  4. root = true
  5. [*.cs]
  6. #Namespace settings
  7. csharp_style_namespace_declarations = file_scoped
  8. dotnet_diagnostic.IDE0161.severity = warning
  9. #Core editorconfig formatting - indentation
  10. #use tabs for indentation
  11. indent_style = tabs
  12. #Formatting - indentation options
  13. #indent switch case contents.
  14. csharp_indent_case_contents = true
  15. #indent switch labels
  16. csharp_indent_switch_labels = true
  17. #Formatting - new line options
  18. #place catch statements on a new line
  19. csharp_new_line_before_catch = true
  20. #place else statements on a new line
  21. csharp_new_line_before_else = true
  22. #require members of object intializers to be on separate lines
  23. csharp_new_line_before_members_in_object_initializers = true
  24. #require braces to be on a new line for object_collection_array_initializers, methods, control_blocks, types, and lambdas (also known as "Allman" style)
  25. csharp_new_line_before_open_brace = object_collection_array_initializers, methods, control_blocks, types, lambdas
  26. #Formatting - organize using options
  27. #sort System.* using directives alphabetically, and place them before other usings
  28. dotnet_sort_system_directives_first = true
  29. #Formatting - spacing options
  30. #require NO space between a cast and the value
  31. csharp_space_after_cast = false
  32. #require a space before the colon for bases or interfaces in a type declaration
  33. csharp_space_after_colon_in_inheritance_clause = true
  34. #require a space after a keyword in a control flow statement such as a for loop
  35. csharp_space_after_keywords_in_control_flow_statements = true
  36. #require a space before the colon for bases or interfaces in a type declaration
  37. csharp_space_before_colon_in_inheritance_clause = true
  38. #remove space within empty argument list parentheses
  39. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  40. #remove space between method call name and opening parenthesis
  41. csharp_space_between_method_call_name_and_opening_parenthesis = false
  42. #do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
  43. csharp_space_between_method_call_parameter_list_parentheses = false
  44. #remove space within empty parameter list parentheses for a method declaration
  45. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  46. #place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
  47. csharp_space_between_method_declaration_parameter_list_parentheses = false
  48. #Formatting - wrapping options
  49. #leave code block on single line
  50. csharp_preserve_single_line_blocks = true
  51. #Style - Code block preferences
  52. #prefer curly braces even for one line of code
  53. csharp_prefer_braces = true:suggestion
  54. #Style - expression bodied member options
  55. #prefer block bodies for constructors
  56. csharp_style_expression_bodied_constructors = false:suggestion
  57. #prefer block bodies for methods
  58. csharp_style_expression_bodied_methods = false:suggestion
  59. #prefer expression-bodied members for properties
  60. csharp_style_expression_bodied_properties = true:suggestion
  61. #Style - expression level options
  62. #prefer out variables to be declared inline in the argument list of a method call when possible
  63. csharp_style_inlined_variable_declaration = true:suggestion
  64. #prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
  65. dotnet_style_predefined_type_for_member_access = true:suggestion
  66. #Style - Expression-level preferences
  67. #prefer default over default(T)
  68. csharp_prefer_simple_default_expression = true:suggestion
  69. #prefer objects to be initialized using object initializers when possible
  70. dotnet_style_object_initializer = true:suggestion
  71. #prefer inferred tuple element names
  72. dotnet_style_prefer_inferred_tuple_names = true:suggestion
  73. #Style - implicit and explicit types
  74. #prefer var over explicit type in all cases, unless overridden by another code style rule
  75. csharp_style_var_elsewhere = true:suggestion
  76. #prefer var is used to declare variables with built-in system types such as int
  77. csharp_style_var_for_built_in_types = true:suggestion
  78. #prefer var when the type is already mentioned on the right-hand side of a declaration expression
  79. csharp_style_var_when_type_is_apparent = true:suggestion
  80. #Style - language keyword and framework type options
  81. #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
  82. dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
  83. #Style - Miscellaneous preferences
  84. #prefer local functions over anonymous functions
  85. csharp_style_pattern_local_over_anonymous_function = true:suggestion
  86. #Style - modifier options
  87. #prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods.
  88. dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
  89. #Style - Modifier preferences
  90. #when this rule is set to a list of modifiers, prefer the specified ordering.
  91. csharp_preferred_modifier_order = public,protected,private,virtual,async,readonly,static,override,abstract:suggestion
  92. #Style - Pattern matching
  93. #prefer pattern matching instead of is expression with type casts
  94. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  95. #Style - qualification options
  96. #prefer fields not to be prefaced with this. or Me. in Visual Basic
  97. dotnet_style_qualification_for_field = false:suggestion
  98. #prefer methods not to be prefaced with this. or Me. in Visual Basic
  99. dotnet_style_qualification_for_method = false:suggestion
  100. #prefer properties not to be prefaced with this. or Me. in Visual Basic
  101. dotnet_style_qualification_for_property = false:suggestion