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.

121 lines
4.2 KiB

  1. ; Top-most EditorConfig file
  2. root = true
  3. [*]
  4. indent_style = tab
  5. indent_size = 4
  6. guidelines = 110
  7. [*.il]
  8. indent_style = space
  9. indent_size = 2
  10. [*.{yml,yaml}]
  11. indent_style = space
  12. indent_size = 2
  13. [*.csproj]
  14. indent_style = space
  15. indent_size = 2
  16. [*.config]
  17. indent_style = space
  18. indent_size = 2
  19. [*.nuspec]
  20. indent_style = space
  21. indent_size = 2
  22. [*.vsixmanifest]
  23. indent_style = space
  24. indent_size = 2
  25. [*.vsct]
  26. indent_style = space
  27. indent_size = 2
  28. [*.cs]
  29. # New line preferences
  30. csharp_new_line_before_open_brace = methods, types, control_blocks, local_functions
  31. csharp_new_line_before_else = true
  32. csharp_new_line_before_catch = true
  33. csharp_new_line_before_finally = true
  34. csharp_new_line_before_members_in_object_initializers = false
  35. csharp_new_line_before_members_in_anonymous_types = false
  36. csharp_new_line_within_query_expression_clauses = false
  37. # Indentation preferences
  38. csharp_indent_block_contents = true
  39. csharp_indent_braces = false
  40. csharp_indent_case_contents = true
  41. csharp_indent_case_contents_when_block = false
  42. csharp_indent_switch_labels = true
  43. csharp_indent_labels = one_less
  44. # Avoid 'this.' in generated code unless absolutely necessary, but allow developers to use it
  45. dotnet_style_qualification_for_field = false:silent
  46. dotnet_style_qualification_for_property = false:silent
  47. dotnet_style_qualification_for_method = false:silent
  48. dotnet_style_qualification_for_event = false:silent
  49. # Do not use 'var' when generating code, but allow developers to use it
  50. csharp_style_var_for_built_in_types = false:silent
  51. csharp_style_var_when_type_is_apparent = false:silent
  52. csharp_style_var_elsewhere = false:silent
  53. # Use language keywords instead of BCL types when generating code, but allow developers to use either
  54. dotnet_style_predefined_type_for_locals_parameters_members = true:silent
  55. dotnet_style_predefined_type_for_member_access = true:silent
  56. # Using directives
  57. dotnet_sort_system_directives_first = true
  58. dotnet_separate_import_directive_groups = true
  59. # Wrapping
  60. csharp_preserve_single_line_blocks = true
  61. csharp_preserve_single_line_statements = false
  62. # Code style
  63. csharp_prefer_braces = true:silent
  64. # Expression-level preferences
  65. dotnet_style_object_initializer = true:suggestion
  66. dotnet_style_collection_initializer = true:suggestion
  67. dotnet_style_explicit_tuple_names = true:suggestion
  68. dotnet_style_coalesce_expression = true:suggestion
  69. dotnet_style_null_propagation = true:suggestion
  70. # Expression-bodied members
  71. csharp_style_expression_bodied_methods = false:silent
  72. csharp_style_expression_bodied_constructors = false:silent
  73. csharp_style_expression_bodied_operators = false:silent
  74. csharp_style_expression_bodied_properties = true:silent
  75. csharp_style_expression_bodied_indexers = true:silent
  76. csharp_style_expression_bodied_accessors = true:silent
  77. # Pattern matching
  78. csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
  79. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  80. csharp_style_inlined_variable_declaration = true:suggestion
  81. # Null checking preferences
  82. csharp_style_throw_expression = true:suggestion
  83. csharp_style_conditional_delegate_call = true:suggestion
  84. # Space preferences
  85. csharp_space_after_cast = false
  86. csharp_space_after_colon_in_inheritance_clause = true
  87. csharp_space_after_comma = true
  88. csharp_space_after_dot = false
  89. csharp_space_after_keywords_in_control_flow_statements = true
  90. csharp_space_after_semicolon_in_for_statement = true
  91. csharp_space_around_binary_operators = before_and_after
  92. csharp_space_around_declaration_statements = do_not_ignore
  93. csharp_space_before_colon_in_inheritance_clause = true
  94. csharp_space_before_comma = false
  95. csharp_space_before_dot = false
  96. csharp_space_before_open_square_brackets = false
  97. csharp_space_before_semicolon_in_for_statement = false
  98. csharp_space_between_empty_square_brackets = false
  99. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  100. csharp_space_between_method_call_name_and_opening_parenthesis = false
  101. csharp_space_between_method_call_parameter_list_parentheses = false
  102. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  103. csharp_space_between_method_declaration_name_and_open_parenthesis = false
  104. csharp_space_between_method_declaration_parameter_list_parentheses = false
  105. csharp_space_between_parentheses = false
  106. csharp_space_between_square_brackets = false