1+ # To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2+
3+ # Visual Studio Default Template
4+
5+ # Additions / Modifications
6+ # Style Definitions taken from https://github.com/dotnet/roslyn/blob/master/.editorconfig
7+ # indent_style = tab
8+ # dotnet_style_qualification_for_field = true:silent
9+ # Merge static_fields and instance_fields naming rule and remove prefix
10+ # csharp_style_var_for_built_in_types = false:silent
11+ # csharp_style_var_when_type_is_apparent = false:silent
12+ # csharp_style_var_elsewhere = false:silent
13+ # csharp_style_expression_bodied_methods = when_on_single_line:silent
14+
15+ # top-most EditorConfig file
16+ root = true
17+
18+ [* ]
19+ indent_style = tab
20+ # (Please don't specify an indent_size here; that has too many unintended consequences.)
21+
22+ # Code files
23+ [* .{cs,csx,vb,vbx} ]
24+ indent_size = 4
25+ insert_final_newline = false
26+ charset = utf-8-bom
27+
28+ # XML project files
29+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
30+ indent_size = 2
31+
32+ # XML config files
33+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
34+ indent_size = 2
35+
36+ # JSON files
37+ [* .json ]
38+ indent_size = 2
39+
40+ # Powershell files
41+ [* .ps1 ]
42+ indent_size = 2
43+
44+ # Shell script files
45+ [* .sh ]
46+ end_of_line = lf
47+ indent_size = 2
48+
49+ # Dotnet code style settings:
50+ [* .{cs,vb} ]
51+
52+ # ##############################
53+ # .NET Coding Conventions #
54+ # ##############################
55+ [* .{cs,vb} ]
56+ # Organize usings
57+ dotnet_sort_system_directives_first = true
58+ # this. preferences
59+ dotnet_style_qualification_for_field = true :silent
60+ dotnet_style_qualification_for_property = false :silent
61+ dotnet_style_qualification_for_method = false :silent
62+ dotnet_style_qualification_for_event = false :silent
63+ # Language keywords vs BCL types preferences
64+ dotnet_style_predefined_type_for_locals_parameters_members = true :silent
65+ dotnet_style_predefined_type_for_member_access = true :silent
66+ # Parentheses preferences
67+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
68+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
69+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
70+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
71+ # Modifier preferences
72+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
73+ dotnet_style_readonly_field = true :suggestion
74+ # Expression-level preferences
75+ dotnet_style_object_initializer = true :suggestion
76+ dotnet_style_collection_initializer = true :suggestion
77+ dotnet_style_explicit_tuple_names = true :suggestion
78+ dotnet_style_null_propagation = true :suggestion
79+ dotnet_style_coalesce_expression = true :suggestion
80+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :silent
81+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
82+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
83+ dotnet_style_prefer_auto_properties = true :silent
84+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
85+ dotnet_style_prefer_conditional_expression_over_return = true :silent
86+ # ##############################
87+ # Naming Conventions #
88+ # ##############################
89+ # Style Definitions
90+
91+ # Non-private static fields are PascalCase
92+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
93+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
94+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style
95+
96+ dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
97+ dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
98+ dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
99+
100+ dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
101+
102+ # Non-private readonly fields are PascalCase
103+ dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
104+ dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
105+ dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style
106+
107+ dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
108+ dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
109+ dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
110+
111+ dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case
112+
113+ # Constants are PascalCase
114+ dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
115+ dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
116+ dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
117+
118+ dotnet_naming_symbols.constants.applicable_kinds = field, local
119+ dotnet_naming_symbols.constants.required_modifiers = const
120+
121+ dotnet_naming_style.constant_style.capitalization = pascal_case
122+
123+ # Fields are camelCase
124+ dotnet_naming_rule.fields_should_be_camel_case.severity = suggestion
125+ dotnet_naming_rule.fields_should_be_camel_case.symbols = fields
126+ dotnet_naming_rule.fields_should_be_camel_case.style = fields_style
127+
128+ dotnet_naming_symbols.fields.applicable_kinds = field
129+ dotnet_naming_symbols.fields.required_modifiers = static
130+
131+ dotnet_naming_style.fields_style.capitalization = camel_case
132+
133+ # Locals and parameters are camelCase
134+ dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
135+ dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
136+ dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
137+
138+ dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
139+
140+ dotnet_naming_style.camel_case_style.capitalization = camel_case
141+
142+ # Local functions are PascalCase
143+ dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
144+ dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
145+ dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
146+
147+ dotnet_naming_symbols.local_functions.applicable_kinds = local_function
148+
149+ dotnet_naming_style.local_function_style.capitalization = pascal_case
150+
151+ # By default, name items with PascalCase
152+ dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
153+ dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
154+ dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
155+
156+ dotnet_naming_symbols.all_members.applicable_kinds = *
157+
158+
159+ # ##############################
160+ # C# Coding Conventions #
161+ # ##############################
162+ [* .cs ]
163+ # Indentation preferences
164+ csharp_indent_block_contents = true
165+ csharp_indent_braces = false
166+ csharp_indent_case_contents = true
167+ csharp_indent_case_contents_when_block = true
168+ csharp_indent_switch_labels = true
169+ csharp_indent_labels = flush_left
170+ # var preferences
171+ csharp_style_var_for_built_in_types = false :silent
172+ csharp_style_var_when_type_is_apparent = false :silent
173+ csharp_style_var_elsewhere = false :silent
174+ # Expression-bodied members
175+ csharp_style_expression_bodied_methods = when_on_single_line:silent
176+ csharp_style_expression_bodied_constructors = false :silent
177+ csharp_style_expression_bodied_operators = false :silent
178+ csharp_style_expression_bodied_properties = true :silent
179+ csharp_style_expression_bodied_indexers = true :silent
180+ csharp_style_expression_bodied_accessors = true :silent
181+ # Pattern matching preferences
182+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
183+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
184+ # Null-checking preferences
185+ csharp_style_throw_expression = true :suggestion
186+ csharp_style_conditional_delegate_call = true :suggestion
187+ # Modifier preferences
188+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
189+ # Expression-level preferences
190+ csharp_prefer_braces = true :silent
191+ csharp_style_deconstructed_variable_declaration = true :suggestion
192+ csharp_prefer_simple_default_expression = true :suggestion
193+ csharp_style_pattern_local_over_anonymous_function = true :suggestion
194+ csharp_style_inlined_variable_declaration = true :suggestion
195+ # ##############################
196+ # C# Formatting Rules #
197+ # ##############################
198+ # New line preferences
199+ csharp_new_line_before_open_brace = all
200+ csharp_new_line_before_else = true
201+ csharp_new_line_before_catch = true
202+ csharp_new_line_before_finally = true
203+ csharp_new_line_before_members_in_object_initializers = true
204+ csharp_new_line_before_members_in_anonymous_types = true
205+ csharp_new_line_between_query_expression_clauses = true
206+ # Indentation preferences
207+ csharp_indent_case_contents = true
208+ csharp_indent_switch_labels = true
209+ csharp_indent_labels = flush_left
210+ # Space preferences
211+ csharp_space_after_cast = false
212+ csharp_space_after_keywords_in_control_flow_statements = true
213+ csharp_space_between_method_call_parameter_list_parentheses = false
214+ csharp_space_between_method_declaration_parameter_list_parentheses = false
215+ csharp_space_between_parentheses = false
216+ csharp_space_before_colon_in_inheritance_clause = true
217+ csharp_space_after_colon_in_inheritance_clause = true
218+ csharp_space_around_binary_operators = before_and_after
219+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
220+ csharp_space_between_method_call_name_and_opening_parenthesis = false
221+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
222+ # Wrapping preferences
223+ csharp_preserve_single_line_statements = true
224+ csharp_preserve_single_line_blocks = true
225+
226+ # StyleCop.Analyzers
227+
228+ # SA1101: Prefix local calls with this
229+ dotnet_diagnostic.SA1101.severity = none
230+ # SA1116: Split parameters should start on line after declaration
231+ dotnet_diagnostic.SA1116.severity = none
232+ # SA1117: Parameters should be on same line or separate lines
233+ dotnet_diagnostic.SA1117.severity = none
234+ # SA1127: Generic type constraints should be on their own line
235+ dotnet_diagnostic.SA1127.severity = none
236+ # SA1128: Put constructor initializers on their own line
237+ dotnet_diagnostic.SA1128.severity = none
238+ # SA1600: Elements should be documented
239+ dotnet_diagnostic.SA1600.severity = none
240+ # SA1601: Partial elements should be documented
241+ dotnet_diagnostic.SA1601.severity = none
242+ # SA1602: Enumeration items should be documented
243+ dotnet_diagnostic.SA1602.severity = none
244+
245+ # FxCopAnalyzers
246+
247+ # CA1303: Do not pass literals as localized parameters
248+ dotnet_diagnostic.CA1303.severity = none
0 commit comments