Guest User

Untitled

a guest
Dec 13th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.73 KB | None | 0 0
  1. ###############################
  2. # Core EditorConfig Options #
  3. ###############################
  4. root = true
  5.  
  6. # All files
  7. [*]
  8. indent_style = space
  9.  
  10. # Code files
  11. [*.{cs,csx,vb,vbx}]
  12. indent_size = 4
  13. insert_final_newline = true
  14. charset = utf-8-bom
  15.  
  16. # Xml build files
  17. [*.builds]
  18. indent_size = 2
  19.  
  20. # Xml files
  21. [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,xml,stylecop}]
  22. indent_size = 2
  23.  
  24. # Xml project files
  25. [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
  26. indent_size = 2
  27.  
  28. # Json files
  29. [*.json]
  30. indent_size = 2
  31.  
  32. # C++ Files
  33. [*.{cpp,h,in}]
  34. curly_bracket_next_line = true
  35. indent_brace_style = Allman
  36.  
  37. # Shell scripts
  38. [*.sh]
  39. end_of_line = lf
  40. [*.{cmd, bat}]
  41. end_of_line = crlf
  42.  
  43. ###############################
  44. # .NET OSS Coding Conventions #
  45. ###############################
  46. [*.{cs,vb}]
  47. # Organize usings
  48. dotnet_sort_system_directives_first = true
  49.  
  50. # Avoid this. unless absolutely necessary
  51. dotnet_style_qualification_for_field = false:suggestion
  52. dotnet_style_qualification_for_property = false:suggestion
  53. dotnet_style_qualification_for_method = false:suggestion
  54. dotnet_style_qualification_for_event = false:suggestion
  55.  
  56. # Use language keywords instead of BCL types
  57. dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
  58. dotnet_style_predefined_type_for_member_access = true:suggestion
  59.  
  60. # Expression-level preferences
  61. dotnet_style_object_initializer = true:suggestion
  62. dotnet_style_collection_initializer = true:suggestion
  63. dotnet_style_explicit_tuple_names = true:suggestion
  64. dotnet_style_null_propagation = true:suggestion
  65. dotnet_style_coalesce_expression = true:suggestion
  66. dotnet_style_prefer_is_null_check_over_reference_equality_method = true:none
  67. dotnet_style_require_accessibility_modifiers = always:suggestion
  68. dotnet_prefer_inferred_tuple_names = true:suggestion
  69. dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
  70.  
  71. [*.cs]
  72. # Expression-bodied members
  73. csharp_style_expression_bodied_methods = false:none
  74. csharp_style_expression_bodied_constructors = false:none
  75. csharp_style_expression_bodied_operators = false:none
  76. csharp_style_expression_bodied_properties = true:none
  77. csharp_style_expression_bodied_indexers = true:none
  78. csharp_style_expression_bodied_accessors = true:none
  79.  
  80. # Pattern matching
  81. csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
  82. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  83. csharp_style_inlined_variable_declaration = true:suggestion
  84.  
  85. # Null-checking preferences
  86. csharp_style_throw_expression = true:suggestion
  87. csharp_style_conditional_delegate_call = true:suggestion
  88.  
  89. # Expression-level preferences
  90. csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
  91.  
  92. [*.vb]
  93. visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
  94.  
  95. ###############################
  96. # .NET Formatting Rules #
  97. ###############################
  98. [*.cs]
  99. # New line preferences
  100. csharp_new_line_before_open_brace = all
  101. csharp_new_line_before_else = true
  102. csharp_new_line_before_catch = true
  103. csharp_new_line_before_finally = true
  104. csharp_new_line_before_members_in_object_initializers = true
  105. csharp_new_line_before_members_in_anonymous_types = true
  106. csharp_new_line_between_query_expression_clauses = true
  107.  
  108. # Indentation preferences
  109. csharp_indent_case_contents = true
  110. csharp_indent_switch_labels = true
  111. csharp_indent_labels = flush_left
  112.  
  113. # Space preferences
  114. csharp_space_after_cast = false
  115. csharp_space_after_keywords_in_control_flow_statements = true
  116. csharp_space_between_method_call_parameter_list_parentheses = false
  117. csharp_space_between_method_declaration_parameter_list_parentheses = false
  118. csharp_space_between_parentheses = false
  119.  
  120. ###############################
  121. # Roslyn-Specific Conventions #
  122. ###############################
  123. # Always use var
  124. csharp_style_var_for_built_in_types = true:suggestion
  125. csharp_style_var_when_type_is_apparent = true:suggestion
  126. csharp_style_var_elsewhere = true:suggestion
  127.  
  128. # Expression-level preferences
  129. csharp_prefer_braces = true:suggestion
  130. csharp_style_deconstructed_variable_declaration = true:suggestion
  131. csharp_prefer_simple_default_expression = true:suggestion
  132. csharp_style_pattern_local_over_anonymous_function = true:suggestion
  133.  
  134. ###############################
  135. # Naming Conventions #
  136. ###############################
  137.  
  138. # Style Definitions
  139. dotnet_naming_style.pascal_case_style.capitalization = pascal_case
  140.  
  141. dotnet_naming_style.camel_case_style.capitalization = camel_case
  142.  
  143. dotnet_naming_style.camel_case_underscore_style.required_prefix = _
  144. dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
  145.  
  146. dotnet_naming_style.static_prefix_style.required_prefix = s_
  147. dotnet_naming_style.static_prefix_style.capitalization = camel_case
  148.  
  149. dotnet_naming_style.I_prefix_style.required_prefix = I
  150. dotnet_naming_style.I_prefix_style.capitalization = pascal_case
  151.  
  152. # Use PascalCase for constant fields
  153. dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
  154. dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
  155. dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
  156. dotnet_naming_symbols.constant_fields.applicable_kinds = field
  157. dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
  158. dotnet_naming_symbols.constant_fields.required_modifiers = const
  159.  
  160. # Use s_ prefix for static fields
  161. dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
  162. dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
  163. dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
  164. dotnet_naming_symbols.static_fields.applicable_kinds = field
  165. dotnet_naming_symbols.static_fields.applicable_accessibilities = *
  166. dotnet_naming_symbols.static_fields.required_modifiers = static
  167.  
  168. # Use _camelCase for internal and private fields
  169. dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
  170. dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
  171. dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
  172. dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
  173. dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
  174.  
  175. # ROSLYN
  176. # Use PascalCase for public fields
  177. dotnet_naming_rule.pascal_case_for_public_fields.severity = suggestion
  178. dotnet_naming_rule.pascal_case_for_public_fields.symbols = public_fields
  179. dotnet_naming_rule.pascal_case_for_public_fields.style = pascal_case_style
  180. dotnet_naming_symbols.public_fields.applicable_kinds = field
  181. dotnet_naming_symbols.public_fields.applicable_accessibilities = public
  182.  
  183. # Use _camelCase for all other fields
  184. dotnet_naming_rule.camel_case_for_other_fields.severity = suggestion
  185. dotnet_naming_rule.camel_case_for_other_fields.symbols = other_fields
  186. dotnet_naming_rule.camel_case_for_other_fields.style = camel_case_underscore_style
  187. dotnet_naming_symbols.other_fields.applicable_kinds = field
  188. dotnet_naming_symbols.other_fields.applicable_accessibilities = *
  189.  
  190. # Interfaces must be PascalCase and have an I prefix
  191. dotnet_naming_rule.interfaces_start_with_I.severity = suggestion
  192. dotnet_naming_rule.interfaces_start_with_I.symbols = any_interface
  193. dotnet_naming_rule.interfaces_start_with_I.style = I_prefix_style
  194. dotnet_naming_symbols.any_interface.applicable_accessibilities = *
  195. dotnet_naming_symbols.any_interface.applicable_kinds = interface
  196.  
  197. # Classes, structs, methods, enums, events, properties, namespaces, delegates must be PascalCase
  198. dotnet_naming_rule.general_naming.severity = suggestion
  199. dotnet_naming_rule.general_naming.symbols = general
  200. dotnet_naming_rule.general_naming.style = pascal_case_style
  201. dotnet_naming_symbols.general.applicable_kinds = class,struct,enum,property,method,event,namespace,delegate
  202. dotnet_naming_symbols.general.applicable_accessibilities = *
  203.  
  204. # Everything else is camelCase
  205. dotnet_naming_rule.everything_else_naming.severity = suggestion
  206. dotnet_naming_rule.everything_else_naming.symbols = everything_else
  207. dotnet_naming_rule.everything_else_naming.style = camel_case_style
  208. dotnet_naming_symbols.everything_else.applicable_kinds = *
  209. dotnet_naming_symbols.everything_else.applicable_accessibilities = *
Add Comment
Please, Sign In to add comment